Skip to content

Commit 186ce07

Browse files
eli-263 modify _status endpoint
1 parent 3d176c7 commit 186ce07

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

sandbox/app.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
import logging
88
import os
99
import sys
10+
from http import HTTPStatus
1011

1112
import requests # pyright: ignore [reportMissingModuleSource]
12-
from flask import Flask, Request, Response, request # pyright: ignore [reportMissingImports]
13+
from flask import Flask, Request, Response, request, make_response # pyright: ignore [reportMissingImports]
1314

1415
# Configure logging to output to stdout
1516
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@@ -155,13 +156,31 @@ def parse_prefer_header_value(prefer_header_value: str) -> str:
155156
return ""
156157

157158

158-
@app.route("/_status", methods=["GET"])
159+
@app.route("/patient-check/_status", methods=["GET"])
159160
def health_check() -> Response:
160161
"""
161162
Health-check endpoint to verify the application is running.
162163
Returns a 200 OK status with a simple JSON response.
163164
"""
164-
return Response('{"status": "ok"}', status=200, mimetype="application/json")
165+
status_json = {
166+
"status": "pass",
167+
"version": "",
168+
"revision": "",
169+
"releaseId": "",
170+
"commitId": "",
171+
"checks": {
172+
"healthcheckService:status": [
173+
{
174+
"status": "pass",
175+
"timeout": False,
176+
"responseCode": 200,
177+
"outcome": "<html><h1>Ok</h1></html>",
178+
"links": {"self": f"https://default-eligibility-signposting-api-live/patient-check/_status"},
179+
}
180+
]
181+
},
182+
}
183+
return make_response(status_json, HTTPStatus.OK, {"Content-Type": "application/json"})
165184

166185

167186
@app.route("/", defaults={"path": ""})

0 commit comments

Comments
 (0)