Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: services: helper: Add root page #3012

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions core/services/helper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)
from commonwealth.utils.logs import InterceptHandler, init_logger
from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastapi_versioning import VersionedFastAPI, version
from loguru import logger
from pydantic import BaseModel
Expand Down Expand Up @@ -646,6 +647,19 @@ async def periodic() -> None:
enable_latest=True,
)


@app.get("/")
async def root() -> HTMLResponse:
html_content = """
<html>
<head>
<title>Helper</title>
</head>
</html>
"""
return HTMLResponse(content=html_content, status_code=200)


port_to_service_map: Dict[int, str] = parse_nginx_file("/home/pi/tools/nginx/nginx.conf")

if __name__ == "__main__":
Expand Down