This pull request refactors the API routing and endpoints to improve clarity and separation of concerns. #15
Merged
goldlabelapps merged 2 commits intomasterfrom Mar 20, 2026
Merged
Conversation
Add a new favicon.ico binary file under app/static so browsers can display the site icon. This commit adds the site's favicon to the static assets directory.
Introduce a new app/api/products.py endpoint that queries Postgres (psycopg2) using env vars and returns product records with meta information. Simplify app/api/root.py by removing direct DB access: root now exposes API metadata and a list of endpoints (uses BASE_URL). Update app/api/routes.py to import and include the new products router and remove now-unused DB-related imports. These changes separate product data handling from the root endpoint and keep routing organized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main changes are the creation of a dedicated
productsendpoint, removal of product data retrieval from the root endpoint, and updates to the API route definitions. These updates help organize the codebase and make the API more maintainable.API endpoint refactoring:
/productsendpoint inapp/api/products.pythat retrieves product data directly from the database and returns it in a structured format.app/api/root.pyto return only metadata and a list of available endpoints, instead of product data. The root now includesbase_urland links tohealthandproductsendpoints.Route organization:
products_routerin the API router setup inapp/api/routes.py, ensuring the/productsendpoint is available.app/api/routes.py.