File tree Expand file tree Collapse file tree 4 files changed +37
-17
lines changed
Expand file tree Collapse file tree 4 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 11"""API routes package."""
22
3+ from fastapi import APIRouter
4+
5+ from app .api .routes import admin , documents
6+
7+ router = APIRouter (prefix = "/api/v1" )
8+
9+ router .include_router (documents .router )
10+ router .include_router (admin .router )
Original file line number Diff line number Diff line change 1+ from fastapi import APIRouter
2+
3+ router = APIRouter (prefix = "/admin" , tags = ["admin" ])
4+
5+ @router .get ("/health" )
6+ def admin_health ():
7+ return {"status" : "ok" }
8+
9+ @router .get ("/ping" )
10+ def admin_ping ():
11+ return {"pong" : True }
Original file line number Diff line number Diff line change 1+ from fastapi import APIRouter
2+
3+ router = APIRouter (tags = ["base" ])
4+
5+ @router .get ("/" )
6+ async def root ():
7+ return {"message" : "RAGManager up" }
8+
9+ @router .get ("/health" )
10+ def health_check ():
11+ return {"message" : "200 running..." }
Original file line number Diff line number Diff line change 11import logging
22from fastapi import FastAPI
3- from sqlalchemy .exc import OperationalError
43
5- from app .api .routes import documents
4+ from app .api .routes import router as api_router
5+ from app .api .routes .base import router as base_router
66from app .core .database_connection import init_db
77
88# Configure logging
1313
1414app = FastAPI (title = "RAG Manager API" , version = "0.1.0" )
1515
16- # Include routers
17- app .include_router (documents . router )
16+ # Global (non-versioned) routes
17+ app .include_router (base_router )
1818
19+ # Versioned API routes
20+ app .include_router (api_router )
1921
2022@app .on_event ("startup" )
2123async def startup_event ():
@@ -25,16 +27,4 @@ async def startup_event():
2527 logging .info ("Database initialized successfully" )
2628 except Exception as e :
2729 logging .error (f"Failed to initialize database: { e } " )
28- raise
29-
30-
31- @app .get ("/" )
32- async def root ():
33- return {"message" : "Hello World" }
34-
35-
36- @app .get ("/health" )
37- def health_check ():
38- return {"message" : "200 corriendo..." }
39-
40-
30+ raise
You can’t perform that action at this time.
0 commit comments