Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
added debug options to make dev life easier
Browse files Browse the repository at this point in the history
  • Loading branch information
matt01y committed Mar 12, 2024
1 parent 993c5af commit bbcbbca
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@
app.include_router(subject_router, prefix="/api")
app.include_router(group_router, prefix="/api")

DEBUG = False # Should always be false in repo

if DEBUG:
from fastapi.middleware.cors import CORSMiddleware
origins = [
"https://localhost",
"https://localhost:8080",
"http://localhost:5173"
]

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

# Koppel de exception handlers
@app.exception_handler(InvalidRoleCredentialsError)
Expand Down

0 comments on commit bbcbbca

Please sign in to comment.