diff --git a/backend/main.py b/backend/main.py index ef24a3a..3797fb9 100644 --- a/backend/main.py +++ b/backend/main.py @@ -4,7 +4,7 @@ from fastapi.responses import FileResponse from pathlib import Path # Импорт роутера -from .routes.license_routes import router as license_router # Изменено: один dot вместо двух +from .routes.license_routes import router as license_router # Путь к корню проекта BASE_DIR = Path(__file__).resolve().parent @@ -24,9 +24,21 @@ def create_app() -> FastAPI: apps.include_router(license_router, prefix="/api") # Монтируем статические папки фронтенда - apps.mount("/static/css", StaticFiles(directory=BASE_DIR.parent / "frontend" / "css"), name="css") - apps.mount("/static/js", StaticFiles(directory=BASE_DIR.parent / "frontend" / "js"), name="js") - apps.mount("/static/assets", StaticFiles(directory=BASE_DIR.parent / "frontend" / "assets"), name="assets") + apps.mount( + "/static/css", + StaticFiles(directory=BASE_DIR.parent / "frontend" / "css"), + name="css" + ) + apps.mount( + "/static/js", + StaticFiles(directory=BASE_DIR.parent / "frontend" / "js"), + name="js" + ) + apps.mount( + "/static/assets", + StaticFiles(directory=BASE_DIR.parent / "frontend" / "assets"), + name="assets" + ) # Отдача главной страницы @apps.get("/", include_in_schema=False) @@ -34,7 +46,9 @@ def create_app() -> FastAPI: """ Отдает главную страницу сайта (index.html) """ - return FileResponse(BASE_DIR.parent / "frontend" / "templates" / "index.html") + index_file = BASE_DIR.parent / "frontend" / "templates" / "index.html" + return FileResponse(index_file) + return apps # Экземпляр приложения