💥 Remove /widget static endpoint

This endpoint shall be served by a dedicated static HTTP server.
This commit is contained in:
2023-06-13 05:45:33 +02:00
parent f5529bba24
commit 6c149e844b

View File

@@ -4,7 +4,6 @@ import uvicorn
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from fastapi import FastAPI, Request from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi_cache import FastAPICache from fastapi_cache import FastAPICache
from opentelemetry import trace from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
@@ -41,7 +40,6 @@ app.add_middleware(
allow_headers=["*"], allow_headers=["*"],
) )
app.mount("/widget", StaticFiles(directory="../frontend/", html=True), name="widget")
# The cache-control header entry is not managed properly by fastapi-cache: # The cache-control header entry is not managed properly by fastapi-cache:
# For now, a request with a cache-control set to no-cache # For now, a request with a cache-control set to no-cache
@@ -60,7 +58,6 @@ async def fastapi_cache_issue_144_workaround(request: Request, call_next):
return await call_next(request) return await call_next(request)
app.include_router(line.router) app.include_router(line.router)
app.include_router(stop.router) app.include_router(stop.router)