Skip to content

Commit 40f4a48

Browse files
committed
update server
1 parent 4e7365e commit 40f4a48

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Server/server.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,30 @@
3131
UploadFile,
3232
)
3333
from fastapi.responses import JSONResponse, StreamingResponse
34+
from fastapi.middleware.cors import CORSMiddleware
3435
import json
3536

3637
from utils import *
3738
from task_executor import *
3839

3940
# Instanciate FastAPI app
4041
app = FastAPI()
42+
43+
# Configure CORS
44+
origins = [
45+
"https://zama-fhe-private-synthid.static.hf.space",
46+
"http://localhost",
47+
"http://localhost:8000",
48+
]
49+
50+
app.add_middleware(
51+
CORSMiddleware,
52+
allow_origins=origins,
53+
allow_credentials=True,
54+
allow_methods=["*"],
55+
allow_headers=["*"],
56+
)
57+
4158
logger.info(f"🚀 FastAPI server running at {URL}:{FASTAPI_HOST_PORT_HTTPS}")
4259

4360

0 commit comments

Comments
 (0)