nice-bill commited on
Commit
aefb5af
·
1 Parent(s): 49ef7eb

Add root endpoint redirect to /docs

Browse files
Files changed (1) hide show
  1. src/personalization/api/main.py +7 -0
src/personalization/api/main.py CHANGED
@@ -89,6 +89,13 @@ async def lifespan(app: FastAPI):
89
 
90
  app = FastAPI(title="Semantic Book Discovery Engine", lifespan=lifespan)
91
 
 
 
 
 
 
 
 
92
  # Add Prometheus Instrumentation
93
  Instrumentator().instrument(app).expose(app)
94
 
 
89
 
90
  app = FastAPI(title="Semantic Book Discovery Engine", lifespan=lifespan)
91
 
92
+ # Add a root endpoint to redirect to docs
93
+ from fastapi.responses import RedirectResponse
94
+
95
+ @app.get("/")
96
+ async def read_root():
97
+ return RedirectResponse(url="/docs")
98
+
99
  # Add Prometheus Instrumentation
100
  Instrumentator().instrument(app).expose(app)
101