US09-01: Serve the Documentation Inside the Application (#107)
This commit was merged in pull request #107.
This commit is contained in:
@@ -53,6 +53,7 @@ from photo_pipeline.services.thumbnails import ThumbnailService
|
||||
from photo_pipeline.services.upload_batches import UploadBatchService
|
||||
|
||||
FRONTEND_DIR = Path(__file__).resolve().parents[2] / "frontend"
|
||||
DOCS_DIR = Path(__file__).resolve().parents[2] / "docs"
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -151,4 +152,10 @@ def create_app(config: Config | None = None) -> FastAPI:
|
||||
# Static single-page app (hash-routed). Mounted last so /api/v1 wins.
|
||||
if FRONTEND_DIR.is_dir():
|
||||
app.mount("/app", StaticFiles(directory=FRONTEND_DIR, html=True), name="app")
|
||||
# The manuals, as their own markdown files (US09-01). Unauthenticated for the
|
||||
# same reason the application shell is: whoever cannot get past the access
|
||||
# secret is exactly who needs the troubleshooting page, and no document holds
|
||||
# anything a session would protect.
|
||||
if DOCS_DIR.is_dir():
|
||||
app.mount("/docs", StaticFiles(directory=DOCS_DIR), name="docs")
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user