We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e7365e commit 40f4a48Copy full SHA for 40f4a48
Server/server.py
@@ -31,13 +31,30 @@
31
UploadFile,
32
)
33
from fastapi.responses import JSONResponse, StreamingResponse
34
+from fastapi.middleware.cors import CORSMiddleware
35
import json
36
37
from utils import *
38
from task_executor import *
39
40
# Instanciate FastAPI app
41
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
58
logger.info(f"🚀 FastAPI server running at {URL}:{FASTAPI_HOST_PORT_HTTPS}")
59
60
0 commit comments