"Healthcheck" endpoint

This commit is contained in:
simonmicro
2023-05-21 16:53:02 +02:00
parent 58624bdf35
commit 3f7fa53eb3
2 changed files with 5 additions and 4 deletions

View File

@@ -18,7 +18,9 @@ $result = null;
if(isset($_GET['path'])) {
$path = trim($_GET['path'], ' /');
$pathParts = explode('/', $_GET['path']);
if(count($pathParts) > 1 && $pathParts[0] == 'notification') {
if(count($pathParts) > 0 && $pathParts[0] == 'healthz') {
$result = 'OK';
} else if(count($pathParts) > 1 && $pathParts[0] == 'notification') {
// Any notification/[version] will be answered here
$msg = 'Fake API endpoint for v' . $minVersionName . ' active and reachable (contacted at ' . date('r') . ').';
if(intval($pathParts[1]) < $minVersionNumber) {