refactor(backend): clean up router registration pattern
Issue #6: Multiple routers per file made main.py verbose. Changes: - Add 'routers' list export to booking.py and invites.py - Update main.py to iterate over router lists for multi-router modules - Keep explicit registration for single-router modules - Cleaner separation between simple and complex route modules
This commit is contained in:
parent
db7a0dbe28
commit
53aa54d6c9
3 changed files with 15 additions and 6 deletions
|
|
@ -42,16 +42,17 @@ app.add_middleware(
|
|||
allow_credentials=True,
|
||||
)
|
||||
|
||||
# Include routers
|
||||
# Include routers - modules with single router
|
||||
app.include_router(auth_routes.router)
|
||||
app.include_router(sum_routes.router)
|
||||
app.include_router(counter_routes.router)
|
||||
app.include_router(audit_routes.router)
|
||||
app.include_router(profile_routes.router)
|
||||
app.include_router(invites_routes.router)
|
||||
app.include_router(invites_routes.admin_router)
|
||||
app.include_router(availability_routes.router)
|
||||
app.include_router(booking_routes.router)
|
||||
app.include_router(booking_routes.appointments_router)
|
||||
app.include_router(booking_routes.admin_appointments_router)
|
||||
app.include_router(meta_routes.router)
|
||||
|
||||
# Include routers - modules with multiple routers
|
||||
for r in invites_routes.routers:
|
||||
app.include_router(r)
|
||||
for r in booking_routes.routers:
|
||||
app.include_router(r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue