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

Refactored API Routes into Separate Files #263

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

Kavipatel0
Copy link
Contributor

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 the user and auth folders which each have their own respective route collector in auth/index.ts and user/index.ts. This funnels into a central route handler in routes/index.ts which is then app.use() in the original server src/index.ts.

Closes #240

Copy link
Collaborator

@AlexanderWangY AlexanderWangY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these changes and then it LGTM 🚀

@h1divp
Copy link
Collaborator

h1divp commented Sep 10, 2024

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.

@Kavipatel0
Copy link
Contributor Author

👍🏽
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.
😄

Copy link
Collaborator

@AlexanderWangY AlexanderWangY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@AlexanderWangY AlexanderWangY merged commit 6ed72c8 into ufosc:main Sep 10, 2024
2 of 3 checks passed
@h1divp
Copy link
Collaborator

h1divp commented Sep 10, 2024

Thank you both !!

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

Successfully merging this pull request may close these issues.

Abstract and clean up API endpoints
3 participants