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

Refactor src/index.ts #304

Open
pedromtcosta opened this issue Dec 8, 2021 · 0 comments
Open

Refactor src/index.ts #304

pedromtcosta opened this issue Dec 8, 2021 · 0 comments

Comments

@pedromtcosta
Copy link
Collaborator

src/index.ts is very bloated right now. It contains both HTTP handler logic and route registration, as well as some other arbitrary logic. All handler logic should be in dedicated modules, which should also be the one concerned about the HTTP method itself. Regarding handlers, all index should do is calling a function from the handler module passing the current router and the handler module should be the one responsible for registering it. We might also want to create dedicated modules to encapsulate logic for registering middlewares.

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