Skip to content

Commit da69529

Browse files
authored
Update main.py
1 parent de321f5 commit da69529

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
from fastapi import FastAPI
22
from app.routers.v1 import items
33
from app.routers import auth
4+
from fastapi.middleware.cors import CORSMiddleware
45

56
app = FastAPI()
67

8+
origins = ["*"]
9+
10+
app.add_middleware(
11+
CORSMiddleware,
12+
allow_origins=origins,
13+
allow_credentials=True,
14+
allow_methods=["*"],
15+
allow_headers=["*"],
16+
)
17+
718

819
@app.get("/")
920
async def root():

0 commit comments

Comments
 (0)