File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ """Handler for the / endpoint."""
2+
3+ import asyncio
4+ import logging
5+ from typing import Any , Optional
6+
7+ from fastapi import APIRouter , Request
8+ from fastapi .responses import HTMLResponse
9+
10+ logger = logging .getLogger (__name__ )
11+ router = APIRouter (tags = ["root" ])
12+
13+
14+ @router .get ("/" , response_class = HTMLResponse )
15+ def root_endpoint_handler (request : Request ) -> HTMLResponse :
16+ return "<html>foo</html>"
Original file line number Diff line number Diff line change 22
33from fastapi import FastAPI
44
5- from app .endpoints import info , models
5+ from app .endpoints import info , models , root
66
77
88def include_routers (app : FastAPI ) -> None :
@@ -11,5 +11,6 @@ def include_routers(app: FastAPI) -> None:
1111 Args:
1212 app: The `FastAPI` app instance.
1313 """
14+ app .include_router (root .router )
1415 app .include_router (info .router , prefix = "/v1" )
1516 app .include_router (models .router , prefix = "/v1" )
You can’t perform that action at this time.
0 commit comments