Skip to content

This pull request refactors the API routing and endpoints to improve clarity and separation of concerns. #15

Merged
goldlabelapps merged 2 commits intomasterfrom
staging
Mar 20, 2026
Merged

This pull request refactors the API routing and endpoints to improve clarity and separation of concerns. #15
goldlabelapps merged 2 commits intomasterfrom
staging

Conversation

@goldlabelapps
Copy link
Owner

The main changes are the creation of a dedicated products endpoint, 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:

  • Added a new /products endpoint in app/api/products.py that retrieves product data directly from the database and returns it in a structured format.
  • Updated the root endpoint in app/api/root.py to return only metadata and a list of available endpoints, instead of product data. The root now includes base_url and links to health and products endpoints.

Route organization:

  • Included the new products_router in the API router setup in app/api/routes.py, ensuring the /products endpoint is available.
  • Simplified the route definitions and removed unnecessary imports from app/api/routes.py.

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.
@goldlabelapps goldlabelapps merged commit 70e7571 into master Mar 20, 2026
2 checks passed
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.

1 participant