@spokedev/healthchicken
v0.0.9
Published
[](https://gitlab.spokedev.xyz/products/marketplace/healthchicken/commits/master) [;
const express = require("express");
const app = express();
app.use(healthchicken({
serviceName: "cats_n_chickens"
}))
// we now have routes at `cats_n_chickens/healthcheck/ready` and `cats_n_chickens/healthcheck/ping`Specifying dependent services
const healthchicken = require("healthchicken");
const express = require("express");
const app = express();
app.use(healthchicken({
serviceName: "cats_n_chickens",
dependentUrls: ["http://some-other.service"]
}))
// `cats_n_chickens/healthcheck/ready` will now ping `http://some-other.service/healthcheck/ping`
// and fail if it doesn't get a 2xx back.Using a different prefix
const healthchicken = require("healthchicken");
const express = require("express");
const app = express();
app.use(healthchicken({
serviceName: "cats_n_chickens",
prefix: "deathwatch"
}))
// we now have routes at `cats_n_chickens/deathwatch/ready` and `cats_n_chickens/deathwatch/ping`Adding in version
If the version is found as an environment variable as SERVICE_VERSION then it will be output as part of the ready healthcheck.
