Browse Source

Merge pull request #2474 from baptistecs/patch-1

Fix .js mimetype on Windows 11
Timothy Jaeryang Baek 11 tháng trước cách đây
mục cha
commit
25c9fb6a3c
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      backend/main.py

+ 2 - 0
backend/main.py

@@ -8,6 +8,7 @@ import sys
 import logging
 import aiohttp
 import requests
+import mimetypes
 
 from fastapi import FastAPI, Request, Depends, status
 from fastapi.staticfiles import StaticFiles
@@ -408,6 +409,7 @@ app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
 app.mount("/cache", StaticFiles(directory=CACHE_DIR), name="cache")
 
 if os.path.exists(FRONTEND_BUILD_DIR):
+    mimetypes.add_type('text/javascript', '.js')
     app.mount(
         "/",
         SPAStaticFiles(directory=FRONTEND_BUILD_DIR, html=True),