Endpoints defined and exported as functions.

Changed all routes to functions and export them to app.js to handle the
registration of route using the functions exported from this file.
This commit is contained in:
2020-08-28 18:45:33 +02:00
parent a6a84e4b29
commit 51a7107802
2 changed files with 50 additions and 42 deletions

View File

@@ -36,10 +36,19 @@ router.get("/lottery/latest", lottery.latest);
router.get("/lottery/by-date/:date", lottery.byEpochDate);
router.get("/lottery/by-name/:name", lottery.byName);
router.delete('/winners', mustBeAuthenticated, virtual.removeWinners);
router.delete('/attendees', mustBeAuthenticated, virtual.removeAttendees);
router.get('/winners', virtual.winners);
router.get('/winners/secure', mustBeAuthenticated, virtual.winnersSecure);
router.post('/finish', mustBeAuthenticated, virtual.finish);
router.get('/attendee/all', virtual.attendees);
router.get('/attendee/all/secure', mustBeAuthenticated, virtual.attendeesSecure);
router.post('attendee/add', mustBeAuthenticated, virtual.addAttendee);
// router.use("/api/", updateApi);
// router.use("/api/", retrieveApi);
// router.use("/api/", wineinfoApi);
// router.use("/api/lottery", lottery);
router.use("/api/virtual-registration/", virtualRegistrationApi);
// router.use("/api/virtual-registration/", virtualRegistrationApi);
module.exports = router;