Skip to content

Commit 6855c22

Browse files
Merge pull request #18 from Akrog/health
Add /health endpoint
2 parents 6a2a083 + 17a99c1 commit 6855c22

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from starlette.requests import Request
2+
from starlette.responses import JSONResponse, Response
3+
from starlette.routing import Route
4+
5+
6+
async def health(request: Request) -> Response:
7+
return JSONResponse({"status": "ok"})
8+
9+
10+
def get_routes() -> [Route]:
11+
return [
12+
Route("/health", endpoint=health, methods=["GET"]),
13+
]

src/rhos_ls_mcps/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import uvicorn
1616

1717
from rhos_ls_mcps import auth as auth_module
18+
from rhos_ls_mcps import extra_endpoints
1819
from rhos_ls_mcps import oc
1920
from rhos_ls_mcps import osc
2021
from rhos_ls_mcps import settings
@@ -84,6 +85,8 @@ async def lifespan(app: Starlette):
8485
if mcp_ocp:
8586
routes.append(Mount("/openshift", app=mcp_ocp.streamable_http_app()))
8687

88+
routes.extend(extra_endpoints.get_routes())
89+
8790
starlette_app = Starlette(routes=routes, lifespan=lifespan)
8891

8992
# Wrap ASGI application with CORS middleware to allow browser-based clients to work

0 commit comments

Comments
 (0)