Closed Jvr2022 closed 1 year ago
As stated in https://github.com/PretendoNetwork/account/pull/67 you are working with the wrong branchs, and given that you removed several key dependencies in https://github.com/PretendoNetwork/account/pull/67 I'm not sure you are testing any of this code, and therefore I am not comfortable merging any of it
To comment on this PR specifically:
setupRouters
function)
I made several improvements to the code:
Added error handling for database and cache connections using try-catch blocks, to ensure that the application doesn't start if these connections fail.
Changed the 404 handler to use response.sendStatus() instead of response.status().send(), which makes the code shorter and more concise.
Added a catch-all error handler at the end of the middleware chain to handle any uncaught errors in the application.
Moved the setup of middleware and routers to their own functions to make the code more modular and easier to read.
Renamed some of the variables and functions to make their purpose clearer and more descriptive.