Skip to content

Commit

Permalink
#87 feat: redirect to home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
asdftyui committed Jul 28, 2023
1 parent f0ea022 commit 311561f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Backend/web/app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from fastapi.staticfiles import StaticFiles
import uvicorn
from api.home import home_router
from api.input import input_router
from api.output import output_router
from core.preload import preload
from core.config import HOST, PORT


app = FastAPI()
app.mount("/static", StaticFiles(directory="./Frontend"), name="static")

@app.get("/")
def redirect_home():
return RedirectResponse(f"http://{HOST}:{PORT}/home")

if __name__ == '__main__':
app.add_event_handler('startup', preload)
Expand Down

0 comments on commit 311561f

Please sign in to comment.