INNER CODE UNIT · Python

page_not_found_exception_handler

AutomationPanda/bulldoggy-reminders-app · app/main.py:47

async def page_not_found_exception_handler(request: Request, exc: HTTPException):
  if request.url.path.startswith('/api/'):
    return JSONResponse({'detail': exc.detail}, status_code=exc.status_code)
  else:
    return RedirectResponse('/not-found')


# --------------------------------------------------------------------------------
# OpenAPI Customization
# --------------------------------------------------------------------------------

def custom_openapi():
  if app.openapi_schema:
    return app.openapi_schema
  
  description = \
    """Bulldoggy is a web app for tracking reminders.
    It is a full-stack Python app built using FastAPI and HTMX.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…