integrate webserver into cli
integrate webserver into cli
This commit is contained in:
0
pkgs/clan-cli/clan_cli/webui/routers/__init__.py
Normal file
0
pkgs/clan-cli/clan_cli/webui/routers/__init__.py
Normal file
8
pkgs/clan-cli/clan_cli/webui/routers/health.py
Normal file
8
pkgs/clan-cli/clan_cli/webui/routers/health.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
async def health() -> str:
|
||||
return "OK"
|
||||
9
pkgs/clan-cli/clan_cli/webui/routers/root.py
Normal file
9
pkgs/clan-cli/clan_cli/webui/routers/root.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from fastapi import APIRouter, Response
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def root() -> Response:
|
||||
body = "<html><body><h1>Welcome</h1></body></html>"
|
||||
return Response(content=body, media_type="text/html")
|
||||
Reference in New Issue
Block a user