Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import ipaddress
import json
import logging
import mimetypes
import os
import re
import subprocess
Expand Down Expand Up @@ -2121,20 +2120,6 @@ def _empty_payload():
_routes_registry.register(app, _ops_request)
_routes_model_config.register(app, _ops_request)

mimetypes.add_type("application/octet-stream", ".stl")

# --- STL File Serving ---
from fastapi.responses import FileResponse

STL_DIR = Path(__file__).parent / "static" / "stl"
if STL_DIR.exists():
@app.get("/stl/{filename}")
async def serve_stl(filename: str):
stl_path = STL_DIR / filename
if stl_path.exists():
return FileResponse(str(stl_path), media_type="application/octet-stream")
raise HTTPException(status_code=404, detail="File not found")

# --- Static ---

static_dir = Path(__file__).parent / "static"
Expand Down
Loading