nice-bill commited on
Commit
93d5f36
·
1 Parent(s): 8c8106d

Add redirect from root to /docs

Browse files
Files changed (1) hide show
  1. src/book_recommender/api/main.py +8 -0
src/book_recommender/api/main.py CHANGED
@@ -132,6 +132,14 @@ async def add_security_headers(request: Request, call_next):
132
  return response
133
 
134
 
 
 
 
 
 
 
 
 
135
  @app.get(
136
  "/health",
137
  summary="Perform a health check",
 
132
  return response
133
 
134
 
135
+ from fastapi.responses import RedirectResponse
136
+
137
+ @app.get("/", include_in_schema=False)
138
+ async def root():
139
+ """Redirects to the API documentation."""
140
+ return RedirectResponse(url="/docs")
141
+
142
+
143
  @app.get(
144
  "/health",
145
  summary="Perform a health check",