yoroi-graphql-migration-backend icon indicating copy to clipboard operation
yoroi-graphql-migration-backend copied to clipboard

Refactor `src/index.ts`

Open pedromtcosta opened this issue 2 years ago • 0 comments

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.

pedromtcosta avatar Dec 08 '21 13:12 pedromtcosta