Add cors midleware
This commit is contained in:
parent
9cdc0ad923
commit
d8b8c0f801
11
app/main.py
11
app/main.py
|
@ -1,7 +1,16 @@
|
||||||
from fastapi import FastAPI, Depends
|
from fastapi import FastAPI, Depends
|
||||||
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from app import auth, user, server
|
from app import auth, user, server
|
||||||
from os import getenv
|
from os import getenv
|
||||||
app = FastAPI()
|
app = FastAPI(docs_url="/")
|
||||||
|
|
||||||
|
app.add_middleware(
|
||||||
|
CORSMiddleware,
|
||||||
|
allow_origins=["*"],
|
||||||
|
allow_credentials=True,
|
||||||
|
allow_methods=["*"],
|
||||||
|
allow_headers=["*"],
|
||||||
|
)
|
||||||
|
|
||||||
dependencies = list()
|
dependencies = list()
|
||||||
if not getenv('DISABLE_AUTH'):
|
if not getenv('DISABLE_AUTH'):
|
||||||
|
|
Loading…
Reference in New Issue