|
|
@@ -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)
|