Ali2206 commited on
Commit
a957349
·
verified ·
1 Parent(s): 9e1f79a

Update api/routes.py

Browse files
Files changed (1) hide show
  1. api/routes.py +14 -6
api/routes.py CHANGED
@@ -1,9 +1,17 @@
1
  from fastapi import APIRouter
2
- from .routes import auth, patients, pdf
3
 
4
- router = APIRouter()
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- # Include sub-routers
7
- router.include_router(auth.router, prefix="/auth", tags=["auth"])
8
- router.include_router(patients.router, prefix="/ehr", tags=["patients"])
9
- router.include_router(pdf.router, prefix="/ehr/patients", tags=["pdf"])
 
1
  from fastapi import APIRouter
 
2
 
3
+ def get_router():
4
+ router = APIRouter()
5
+
6
+ # Defer imports to avoid circular import
7
+ from .routes import auth, patients, pdf
8
+
9
+ # Include sub-routers
10
+ router.include_router(auth.router, prefix="/auth", tags=["auth"])
11
+ router.include_router(patients.router, prefix="/ehr", tags=["patients"])
12
+ router.include_router(pdf.router, prefix="/ehr/patients", tags=["pdf"])
13
+
14
+ return router
15
 
16
+ # Export the router
17
+ api_router = get_router()