mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-13 11:52:45 +02:00
add CORS headers to responses
This commit is contained in:
parent
a8355687d4
commit
c7cd337bf8
1 changed files with 9 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ from app.repositories.lightning import register_lightning_listener
|
|||
from app.repositories.system import register_hardware_info_gatherer
|
||||
from app.routers import apps, bitcoin, lightning, setup, system
|
||||
from app.sse_starlette import EventSourceResponse
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
|
||||
@registered_configuration
|
||||
|
|
@ -44,6 +45,14 @@ app = VersionedFastAPI(
|
|||
enable_latest=True,
|
||||
)
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
async def on_startup():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue