cors
This commit is contained in:
parent
94f8adf144
commit
ce6a53875a
@ -5,6 +5,7 @@ from bearer.routes.auth import auth
|
||||
from db.DB import DBException
|
||||
import mimetypes
|
||||
from mime.mime import mime_content_type
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from fastapi import FastAPI, File, UploadFile, Form, Response, status, HTTPException
|
||||
|
||||
@ -15,6 +16,14 @@ app = FastAPI()
|
||||
app.include_router(user_route)
|
||||
app.include_router(auth)
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
@app.get("/")
|
||||
def read_root():
|
||||
return {"Hello": "World"}
|
||||
|
Loading…
Reference in New Issue
Block a user