Spaces:
Sleeping
Sleeping
File size: 591 Bytes
2d60193 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
import os
app = FastAPI()
# Dummy endpoint for the future Neural Renderer
@app.get("/api/status")
async def status():
return {"status": "Neuron Engine Offline - Waiting for Model"}
# Serve the React build files
# This looks for the 'dist' folder created by 'npm run build'
app.mount("/", StaticFiles(directory="dist", html=True), name="static")
@app.exception_handler(404)
async def not_found_exception_handler(request, exc):
return FileResponse("dist/index.html") |