|
|
@@ -152,8 +152,10 @@ async def ws_chat(websocket: WebSocket, token: str = Query(...), order_id: int =
|
|
|
manager.disconnect(websocket, order_id)
|
|
|
|
|
|
# Mount Static Files
|
|
|
-if not os.path.exists("uploads"):
|
|
|
- os.makedirs("uploads")
|
|
|
+for sub in ["", "previews", "invoices", "reports"]:
|
|
|
+ path = os.path.join("uploads", sub)
|
|
|
+ if not os.path.exists(path):
|
|
|
+ os.makedirs(path, exist_ok=True)
|
|
|
# Mount static files for uploads and previews with caching
|
|
|
app.mount("/uploads", StaticFiles(directory="uploads", html=False), name="uploads")
|
|
|
|