Refactor/route separation #21
Reference in New Issue
Block a user
No description provided.
Delete Branch "refactor/routeSeparation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Idea
The idea here is to make it more clear what routes we have and what functions they depend on. This moves routers for each endpoint from
server.jsand replaces it with apiRouter where all routes are explicitly defined with the functions they use in a single place.Example
/api/router.jsshould define :and
lottery.jsdefined and exports it's functions by:Progress
updateApi(/api/update.js)retrieveApi(/api/retrieve.js)wineInfoApi(/api/wineinfo.js)lotteryApi(/api/lottery.js)virtualRegistrationApi(/api/virtualRegistration.js)Changes
Backend
/api/router.jsis a single file for apiRoutes, all other js files in/apinow only return functions. 51a7107, a6a84e4, ec80aa8, 262efa0 & 1d714d1iois not registered globally w/app.set('socketio'). fd17e11requests. f6c1e35 & 20dd638/api/messages.jsno longer userequestsnpm package, but node's built inhttps, also messages has clearer function names and always return Promises. 4f054a0.Frontend
positioning.scssfor alignment. Currently only defines.flexand.flex-column. 8268efe.columnwith.button-containerfor alignment. 7684fde/src/routes/vinlottisRouter.jsto/src/router.js. a30dc2a/api.jsendpoints to reflect changes in backend. 6dc4c90/src/utils.jsw/ function for converting date to given format (YY-MM-DD) usingIntl.DateTimeFormat. a7f4f9a