diff --git a/modules/main.py b/modules/main.py index bafa4c16..464576ec 100644 --- a/modules/main.py +++ b/modules/main.py @@ -1,6 +1,7 @@ import tensorrt import importlib import os +import mimetypes from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware @@ -12,11 +13,9 @@ from .frontend import frontend from .shared import ROOT_DIR - def custom_generate_unique_id(route: APIRoute): return route.name - app = FastAPI(generate_unique_id_function=custom_generate_unique_id) allowed_hosts = config.get("allow_hosts") app.add_middleware( @@ -26,6 +25,8 @@ def custom_generate_unique_id(route: APIRoute): allow_methods=["*"], allow_headers=["*"], ) +mimetypes.init() +mimetypes.add_type("application/javascript", ".js") app.include_router(api) app.include_router(frontend)