healthcheck.j
use io;
import "http.j" as http;
try {
def res as http.Response init http.requestWith("GET",
"http://127.0.0.1:8080/healthz", {}, "", 2000, 4096);
if ($res.status != 200) {
io.printf("unhealthy: status %d\n", $res.status);
exit 1;
}
} catch (e) {
io.printf("unhealthy: %s\n", $e.kind);
exit 1;
}