diff --git a/server.py b/server.py index 8ce3bde..bc35ae9 100644 --- a/server.py +++ b/server.py @@ -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"}