From 1f4ea2653f3410920e1766da2a8dfad779fc9714 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 14 May 2026 15:07:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/serve.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/serve.py b/frontend/serve.py index d90c616..740973b 100644 --- a/frontend/serve.py +++ b/frontend/serve.py @@ -99,9 +99,11 @@ from starlette.responses import Response routes = [ WebSocketRoute("/ws/{path:path}", vnc_websocket, name="vnc"), - Route("/api/{path:path}", proxy_api), - Route("/api", proxy_api), - Mount("/", StaticFiles(directory=DIST_DIR, html=True), name="static"), + Route("/api/{path:path}", proxy_api, methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]), + Route("/api", proxy_api, methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]), + Mount("/assets", StaticFiles(directory=os.path.join(DIST_DIR, "assets")), name="static-assets"), + Route("/{path:path}", serve_spa), + Route("/", serve_spa), ] app = Starlette(routes=routes)