We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e424c8 commit 79e10f2Copy full SHA for 79e10f2
fhirsnake/server.py
@@ -2,13 +2,22 @@
2
import uuid
3
4
from fastapi import FastAPI, HTTPException
5
+from fastapi.middleware.cors import CORSMiddleware
6
from initial_resources import get_initial_resources
7
8
logging.basicConfig(level=logging.INFO)
9
10
11
app = FastAPI()
12
13
+if os.getenv("CORS_ALLOW_ALL", "false").lower() == "true":
14
+ app.add_middleware(
15
+ CORSMiddleware,
16
+ allow_origins=["*"],
17
+ allow_credentials=True,
18
+ allow_methods=["*"],
19
+ allow_headers=["*"],
20
+ )
21
22
@app.on_event("startup")
23
async def load_app_data():
0 commit comments