Skip to content

Commit 1f720c0

Browse files
fix: update Starlette route syntax for compatibility
Replace deprecated @app.route() decorator with app.add_route() to support newer Starlette versions that removed the route decorator.
1 parent bd5f5d7 commit 1f720c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/mkdocs_serve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ def serve_with_watch() -> None:
164164
app.add_middleware(SecurityHeadersMiddleware)
165165

166166
# Add health check endpoint
167-
@app.route("/health")
168167
async def health_check(request: Request) -> Response:
169168
return Response("healthy\n", media_type="text/plain")
169+
app.add_route("/health", health_check)
170170

171171
app.mount("/", StaticFiles(directory=site_dir, html=True), name="static")
172172

0 commit comments

Comments
 (0)