1 line
389 B
PHP
1 line
389 B
PHP
<?php header("Content-Type: application/json"); $ch = curl_init("http://localhost:4000/health"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 3); $r = curl_exec($ch); $c = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); http_response_code($c == 200 ? 200 : 503); echo json_encode(["ok" => $c == 200, "port" => 4000, "timestamp" => date("c")]);
|