codelife
codelife copied to clipboard
Refactor API Routes
The current API routes are fractured and repetitive. I made some decisions early on to separate out functionality when not understanding React very well, but Sequelize is meant to handle the routes in a far more robust way that I am using them.
For most of the API routes I have, many of the endpoints that contain things like byid should be collapsed into single query points, modified by URL argument params. This is probably a post-November tech-debt type cleanup.
The idea here was to refactor some API endpoints to reduce duplication. Currently there are some endpoints where the same resource is requested in different ways. For example, finding a project by ID and finding a project by username and project title. This could be refactored by combining the two endpoints and user query params instead of positional URL parameters.
This was never completed due to time and resource constraints and does not affect the functionality of the app in any way, this was merely a reminder for future development.