This commit is contained in:
Артём Кокос
2026-02-24 20:36:40 +07:00
parent a8b7016504
commit fd0b9d4d81
3 changed files with 206 additions and 137 deletions

10
main.py
View File

@@ -50,7 +50,15 @@ app.include_router(control.router, prefix="/control", tags=["Control"])
app.include_router(schedules.router, prefix="/schedules", tags=["Schedules"])
# Статика
app.mount("/", StaticFiles(directory="static", html=True), name="static")
# Мы убираем html=True из корня, чтобы 404-е ошибки API не превращались в загрузку index.html
app.mount("/static", StaticFiles(directory="static"), name="static")
@app.get("/")
async def read_index():
from fastapi.responses import FileResponse
return FileResponse("static/index.html")
if __name__ == "__main__":