feat: add redirect from root to API documentation
This commit is contained in:
1 parent
bc70066bc2
commit
fc46d8fe92
1 file changed
+5
-1
+5
-1
@@ -1,5 +1,5 @@
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from fastapi.responses import JSONResponse
|
||||
from fastapi.responses import JSONResponse, RedirectResponse
|
||||
from pydantic import BaseModel
|
||||
import feedparser
|
||||
import re
|
||||
@@ -31,6 +31,10 @@ app = FastAPI(
|
||||
],
|
||||
)
|
||||
|
||||
@app.get("/", include_in_schema=False)
|
||||
def redirect_to_docs():
|
||||
return RedirectResponse(url="/docs", status_code=307)
|
||||
|
||||
class PegelStation(BaseModel):
|
||||
station_id: str
|
||||
station_title: str | None
|
||||
|
||||
Reference in new issue
Block a user