Files
blog/test/healthcheck.js
T

6 lines
162 B
JavaScript

const port = process.env.PORT || 8080;
fetch(`http://127.0.0.1:${port}/healthz`)
.then((res) => process.exit(res.ok ? 0 : 1))
.catch(() => process.exit(1));