diff --git a/peer_alive.sh b/peer_alive.sh deleted file mode 100644 index f27ca7c96ac76b723bc37f7947eb3da6b7a32e42..0000000000000000000000000000000000000000 --- a/peer_alive.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -DATE=$(date +"%Y%m%d%H%M%S") -RESPONSECODE=$(curl --head --max-time 120 -s -o /dev/null -w "%{http_code}" https://peer.tudelft.nl/api/faculties) -curl --max-time 120 https://peer.tudelft.nl/api/faculties - -if [[ $? -eq 0 && $RESPONSECODE -eq 200 ]] -then - echo "${DATE} alive $? $RESPONSECODE" >> /data_nfs/peer/peer_alive.log -else - echo "${DATE} dead $? $RESPONSECODE" >> /data_nfs/peer/peer_alive.log - /usr/sbin/service peer restart -fi diff --git a/server/src/routes/api.ts b/server/src/routes/api.ts index 64dbcccf7d83d6ce3ab8fc539a2f8d71a7bd5ee2..c1731b5aab6e40db9f3b95f77b0a7213aa3212a3 100644 --- a/server/src/routes/api.ts +++ b/server/src/routes/api.ts @@ -43,9 +43,6 @@ router.get("/authenticated", (req, res) => { res.send({ authenticated: req.isAuthenticated() }); }); -// move faculties outside of checkAndSetAuthentication for debugging -router.use("/faculties", faculties); - // Check always whether someone is logged in before accessing the other routes below // additionally fixes the user object so all fields are copied over from the database router.use(checkAndSetAuthentication); @@ -59,6 +56,7 @@ router.get("/me", async (req, res) => { // TODO: Complete routing of the new API router.use("/users", users); +router.use("/faculties", faculties); router.use("/academicyears", academicyears); router.use("/courses", courses); router.use("/enrollments", enrollments);