feat(frontend): mount static UI at /app with simple auditories/equipment browser
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# backend/main.py
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import RedirectResponse
|
||||
from starlette.staticfiles import StaticFiles
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from backend.routers.equipment_types import equipment_types
|
||||
@@ -29,9 +30,12 @@ def ping():
|
||||
return {"message": "pong"}
|
||||
|
||||
|
||||
# Serve static frontend
|
||||
app.mount("/app", StaticFiles(directory="frontend", html=True), name="frontend")
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return RedirectResponse(url="/docs")
|
||||
return RedirectResponse(url="/app/")
|
||||
|
||||
|
||||
# Подключение роутов
|
||||
|
||||
Reference in New Issue
Block a user