mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: use env values instead of hardcoded
This commit is contained in:
parent
0935744915
commit
6198fd2b93
1 changed files with 2 additions and 4 deletions
6
app.py
6
app.py
|
|
@ -32,12 +32,10 @@ app = FastAPI(
|
||||||
root_path="/"
|
root_path="/"
|
||||||
)
|
)
|
||||||
|
|
||||||
origin_regex = re.compile(r"^http://[\w.-]+\.localhost:3000$")
|
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origin_regex=str(origin_regex.pattern),
|
allow_origin_regex=learnhouse_config.hosting_config.allowed_regexp,
|
||||||
allow_origins=["http://localhost:3000", "http://localhost:3001"],
|
allow_origins=learnhouse_config.hosting_config.allowed_origins,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_headers=["*"]
|
allow_headers=["*"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue