Skip to content

Commit

Permalink
CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
NateShoffner committed Sep 5, 2023
1 parent cd3880c commit 32c60ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import aioredis
from dotenv import load_dotenv
from fastapi_cache import FastAPICache
from fastapi.middleware.cors import CORSMiddleware
from fastapi_cache.backends.redis import RedisBackend
from app.api.routes import items, lists, shops, users
from logtail import LogtailHandler
Expand All @@ -26,6 +27,14 @@
version="0.1.0",
)

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

app.include_router(items.router)
app.include_router(lists.router)
app.include_router(shops.router)
Expand Down

0 comments on commit 32c60ed

Please sign in to comment.