Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base Route and Middleware #76

Open
ezehlivinus opened this issue Oct 6, 2022 · 1 comment
Open

Base Route and Middleware #76

ezehlivinus opened this issue Oct 6, 2022 · 1 comment

Comments

@ezehlivinus
Copy link
Contributor

Given that the routes have grown and will be growing in the future. It is necessary to have

  1. a single file where all the routes are used.
  2. a single middleware file where all the middleware and the route middleware are used/registered

This way route and middleware are separated from the index file, thereby making it smaller, and cleaner.

Example:

-middleware/
--error.middleware.js
--another.middleware.js
--index.middleware.js // import all middleware and use them and export an instance of all the used middleware

Same for routes.

@ezehlivinus
Copy link
Contributor Author

@anomic30 Check this out and assign it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant