Closed Kavipatel0 closed 3 weeks ago
I would rename the index.ts
files into routehandler.ts
or something a bit more clear in order to avoid confusion with /server
's entry point. Besides that, as long as this is tested, I think this is a great change. Perhaps something could be done with the socket endpoints as well.
👍🏽
I implemented the suggested changes. Instead of having index.ts
files managing the route handlers, I renamed them to be more descriptive. Now, userRouteHandler.ts
handles the userRouter and authRouteHandler.ts
manages the authRouter. Both of these are in mainRouteHandler.ts
to improve clarity and structure.
😄
Thank you both !!
Description
Moved API Routes from
index.ts
into a routes folder. Routes folder includes user and auth folders with respective route handlers. Routes are contained within theuser
andauth
folders which each have their own respective route collector inauth/index.ts
anduser/index.ts
. This funnels into a central route handler inroutes/index.ts
which is thenapp.use()
in the original serversrc/index.ts
.Closes #240