Skip to content

Commit

Permalink
allows CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
WasinUddy committed Oct 23, 2023
1 parent 8453cd9 commit b8be70e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware


from app.api.rest.router import router as rest_router
from app.api.web.router import router as web_router
Expand All @@ -15,6 +17,18 @@

app = FastAPI()

origins = [
"https://prometheuzdy.cloud",
"http://prometheuzdy.cloud",
]

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

# Mount the static files directory
app.mount("/static", StaticFiles(directory="app/static"), name="static")
Expand Down

0 comments on commit b8be70e

Please sign in to comment.