Skip to content

Commit

Permalink
Added simple healthz endpoint. (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra authored Dec 13, 2024
1 parent 72051fe commit 557d894
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtimes/eoapi/stac/eoapi/stac/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware
from starlette.requests import Request
from starlette.responses import HTMLResponse
from starlette.responses import HTMLResponse, JSONResponse
from starlette.templating import Jinja2Templates
from starlette_cramjam.middleware import CompressionMiddleware

Expand Down Expand Up @@ -164,6 +164,9 @@ async def viewer_page(request: Request):
media_type="text/html",
)

@app.get("/healthz", response_class=JSONResponse)
async def healthz_page(request: Request):
return JSONResponse({'ping': 'pong!'})

if auth_settings.openid_configuration_url:
oidc_auth = OpenIdConnectAuth.from_settings(auth_settings)
Expand Down

0 comments on commit 557d894

Please sign in to comment.