Added /config endpoint and link in 404 page
The update includes the addition of a new '/config' endpoint in index.php, which returns the application's configuration as a JSON response. A corresponding link to this new endpoint has also been added to the 404 error page.
This commit is contained in:
parent
f75be1fcaf
commit
8af61f97b0
@ -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 = [
|
||||
|
@ -8,6 +8,7 @@
|
||||
<body>
|
||||
<h1>404 Uri {{ path }} not found</h1>
|
||||
<p><a href="/metrics">/metrics</a></p>
|
||||
<p><a href="/config">/config</a></p>
|
||||
<p><a href="/version">/version</a></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user