yoroi-graphql-migration-backend
yoroi-graphql-migration-backend copied to clipboard
Refactor `src/index.ts`
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.