Skip to content

Commit 730c1cc

Browse files
committed
CORS added
1 parent b3ccee7 commit 730c1cc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/main.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
from fastapi import FastAPI
4-
4+
from fastapi.middleware.cors import CORSMiddleware
55
from app import database
66

77
from .routers import post, user, auth, vote
@@ -16,6 +16,15 @@
1616

1717
app = FastAPI()
1818

19+
origins = ["https://www.google.com.mx"]
20+
21+
app.add_middleware(
22+
CORSMiddleware,
23+
allow_origins= origins,
24+
allow_credentials=True,
25+
allow_methods=['*'],
26+
allow_headers=['*'],
27+
)
1928
#models.Base.metadata.create_all(bind=engine)
2029

2130
# ROUTERS

0 commit comments

Comments
 (0)