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