Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
from fastapi.staticfiles import StaticFiles | |
from fastapi.responses import FileResponse | |
from fastapi.middleware.cors import CORSMiddleware | |
app = FastAPI() | |
origins = [ | |
"http://localhost:3000", | |
"localhost:3000", | |
"https://abadesalex-emb-rep.hf.space", | |
] | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=origins, | |
allow_credentials=True, | |
allow_methods=["*"], | |
allow_headers=["*"] | |
) | |
app.mount("/", StaticFiles(directory="app/build", html=True), name="static") | |
# @app.get("/") | |
# def index() -> FileResponse: | |
# return FileResponse(path="/app/build/index.html", media_type="text/html") |