Skip to content

Commit a77382f

Browse files
patrickelectricjoaoantoniocardoso
authored andcommitted
core: services: helper: Add root page
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 7f47a81 commit a77382f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/services/helper/main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
)
3030
from commonwealth.utils.logs import InterceptHandler, init_logger
3131
from fastapi import FastAPI, HTTPException
32+
from fastapi.responses import HTMLResponse
3233
from fastapi_versioning import VersionedFastAPI, version
3334
from loguru import logger
3435
from pydantic import BaseModel
@@ -646,6 +647,19 @@ async def periodic() -> None:
646647
enable_latest=True,
647648
)
648649

650+
651+
@app.get("/")
652+
async def root() -> HTMLResponse:
653+
html_content = """
654+
<html>
655+
<head>
656+
<title>Helper</title>
657+
</head>
658+
</html>
659+
"""
660+
return HTMLResponse(content=html_content, status_code=200)
661+
662+
649663
port_to_service_map: Dict[int, str] = parse_nginx_file("/home/pi/tools/nginx/nginx.conf")
650664

651665
if __name__ == "__main__":

0 commit comments

Comments
 (0)