|
7 | 7 | import logging |
8 | 8 | import os |
9 | 9 | import sys |
| 10 | +from http import HTTPStatus |
10 | 11 |
|
11 | 12 | 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] |
13 | 14 |
|
14 | 15 | # Configure logging to output to stdout |
15 | 16 | logging.basicConfig(stream=sys.stdout, level=logging.INFO) |
@@ -155,13 +156,31 @@ def parse_prefer_header_value(prefer_header_value: str) -> str: |
155 | 156 | return "" |
156 | 157 |
|
157 | 158 |
|
158 | | -@app.route("/_status", methods=["GET"]) |
| 159 | +@app.route("/patient-check/_status", methods=["GET"]) |
159 | 160 | def health_check() -> Response: |
160 | 161 | """ |
161 | 162 | Health-check endpoint to verify the application is running. |
162 | 163 | Returns a 200 OK status with a simple JSON response. |
163 | 164 | """ |
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"}) |
165 | 184 |
|
166 | 185 |
|
167 | 186 | @app.route("/", defaults={"path": ""}) |
|
0 commit comments