diff --git a/index.php b/index.php index 0d7825a..4ad662a 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,10 @@ if($_SERVER["REQUEST_URI"] == '/metrics') { $phpbin = getenv('PHP_BINARY'); $output = shell_exec('CONFIG_FILE="' . $config . '" ' . $phpbin . ' ' . $_SERVER['DOCUMENT_ROOT'] . 'script.php'); echo $output; +} elseif ($_SERVER["REQUEST_URI"] == '/config') { + header('Content-Type: application/json'); + require_once getenv('CONFIG_FILE'); + echo json_encode($config); } elseif ($_SERVER["REQUEST_URI"] == '/version') { header('Content-Type: application/json'); $git = [ diff --git a/templates/404.twig b/templates/404.twig index 76ee3af..f68e587 100644 --- a/templates/404.twig +++ b/templates/404.twig @@ -8,6 +8,7 @@

404 Uri {{ path }} not found

/metrics

+

/config

/version

\ No newline at end of file