INNER CODE UNIT · Python
create_app
BlessedRebuS/Krawl · src/app.py:257
def create_app() -> FastAPI:
"""Create and configure the FastAPI application."""
config = get_config()
secret = config.dashboard_secret_path.lstrip("/")
dashboard_prefix = f"/{secret}"
# Docs live under the secret dashboard path. Only the JSON API router is
# included in the schema (see include_in_schema=False below), so the spec
# stays limited to /api/* without post-processing it.
application = FastAPI(
title="Krawl Dashboard API",
version=KRAWL_VERSION,
description="API endpoints for the Krawl honeypot dashboard.\n\n"
"Endpoints marked with a lock icon require authentication. "
"Authenticate via `POST /api/auth` to obtain a session cookie.",
docs_url=f"{dashboard_prefix}/docs",
redoc_url=None,
openapi_url=f"{dashboard_prefix}/openapi.json",