This commit is contained in:
Kavalar 2023-04-07 16:57:00 +03:00
parent 94f8adf144
commit ce6a53875a

View File

@ -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"}