Skip to content

Commit 940d2bf

Browse files
committed
Move products to package; fix root endpoint key
Refactor products module into a package (app/api/products/products.py) and add app/api/products/__init__.py to re-export the router. Update app/api/routes.py to import the router from the new location. Also fix a typo in app/api/root.py: use the consistent "name" key for the docs endpoint in the root endpoints list.
1 parent a0fe6f7 commit 940d2bf

4 files changed

Lines changed: 3 additions & 2 deletions

File tree

app/api/products/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .products import router

app/api/root.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def root() -> dict:
2222
"message": "Welcome to NX AI!"
2323
}
2424
endpoints = [
25-
{"docs": "docs", "url": f"{base_url}/docs"},
25+
{"name": "docs", "url": f"{base_url}/docs"},
2626
{"name": "health", "url": f"{base_url}/health"},
2727
{"name": "products", "url": f"{base_url}/products"}
2828
]

app/api/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from app.api.health import router as health_router
1515
from app.api.echo import router as echo_router
1616
from app.api.import_csv import router as import_csv_router
17-
from app.api.products import router as products_router
17+
from app.api.products.products import router as products_router
1818

1919
router.include_router(root_router)
2020
router.include_router(health_router)

0 commit comments

Comments
 (0)