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

Commit

Permalink
Move swagger to /api/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
msathieu committed Mar 14, 2024
1 parent 67bc34e commit 8e0c330
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from routes.teacher import teacher_router
from routes.user import users_router

app = FastAPI()
app = FastAPI(docs_url="/api/docs")

# Koppel routes uit andere modules.
app.include_router(student_router, prefix="/api")
Expand All @@ -23,10 +23,11 @@
app.include_router(subject_router, prefix="/api")
app.include_router(group_router, prefix="/api")

DEBUG = False # Should always be false in repo
DEBUG = False # Should always be false in repo

if DEBUG:
from fastapi.middleware.cors import CORSMiddleware

origins = [
"https://localhost",
"https://localhost:8080",
Expand All @@ -41,6 +42,7 @@
allow_headers=["*"],
)


# Koppel de exception handlers
@app.exception_handler(InvalidRoleCredentialsError)
def invalid_admin_credentials_error_handler(request: Request, exc: InvalidRoleCredentialsError) -> JSONResponse:
Expand Down

0 comments on commit 8e0c330

Please sign in to comment.