diff options
| author | 2024-08-19 14:53:41 +0100 | |
|---|---|---|
| committer | 2024-08-19 19:26:46 +0100 | |
| commit | 1c1ecd1f54a9cd8aeedf4095979d7893c52204f8 (patch) | |
| tree | 6c8a9cc091543ba99fd1605b7275c73fe36e44a8 /thallium-backend/src/app.py | |
| parent | Render Voucher ID on validation (diff) | |
Drop static file mount
Diffstat (limited to 'thallium-backend/src/app.py')
| -rw-r--r-- | thallium-backend/src/app.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/thallium-backend/src/app.py b/thallium-backend/src/app.py index 3f65631..69310a7 100644 --- a/thallium-backend/src/app.py +++ b/thallium-backend/src/app.py @@ -7,7 +7,6 @@ from fastapi import FastAPI, Request, Response from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import HTMLResponse, JSONResponse -from fastapi.staticfiles import StaticFiles from scalar_fastapi import get_scalar_api_reference from src.routes import top_level_router @@ -24,7 +23,6 @@ fastapi_app = FastAPI( redoc_url=None, ) fastapi_app.include_router(top_level_router) -fastapi_app.mount("/static", StaticFiles(directory="src/static"), name="static") fastapi_app.add_middleware( CORSMiddleware, @@ -35,7 +33,7 @@ fastapi_app.add_middleware( ) -@fastapi_app.get("/heartbeat") +@fastapi_app.get("/heartbeat", include_in_schema=False) def health_check() -> JSONResponse: """Return basic response, for use as a health check.""" return JSONResponse({"detail": "I am alive!"}) @@ -45,7 +43,7 @@ def build_url(request: Request, path: str = "") -> str: """Build a URL from a request, for OpenAPI + Scalar.""" scheme = request.headers.get("x-forwarded-proto", request.url.scheme) - return f"{scheme}://{request.headers['Host']}{CONFIG.app_prefix}{path}" + return f"{scheme}://{request.headers["Host"]}{CONFIG.app_prefix}{path}" @fastapi_app.get("/docs", include_in_schema=False) |