Skip to content

Commit

Permalink
Error Handling for Unique Keys
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed May 9, 2024
1 parent c7c9b02 commit 9bea1b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions api/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ async def lifespan(app: FastAPI):
allow_headers=["*"],
)

origins = ["http://localhost", "http://127.0.0.1:8000", "https://demo.honcho.dev"]

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


if OPENTELEMTRY_ENABLED:
FastAPIInstrumentor().instrument_app(app)

Expand Down
4 changes: 3 additions & 1 deletion api/src/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
USE_AUTH_SERVICE = os.getenv("USE_AUTH_SERVICE", "False").lower() == "true"
AUTH_SERVICE_URL = os.getenv("AUTH_SERVICE_URL", "http://localhost:8001")

security = HTTPBearer(auto_error=False)
security = HTTPBearer(
auto_error=False,
)


async def auth(
Expand Down

0 comments on commit 9bea1b8

Please sign in to comment.