fastify-healthcheck
Advanced tools
Comparing version 0.1.0 to 0.1.1
# Change Log | ||
## [0.1.1](https://github.com/smartiniOnGitHub/fastify-healthcheck/releases/tag/0.1.1) (2018-11-13) | ||
Summary Changelog: | ||
- Maintenance release to fix Fastify dependencies to '1.x' to avoid breaking changes because Fastify '2.x' will be released soon | ||
- Updated dependencies to latest Fastify plugin (1.2.1) and Fastify 1.x (1.13.0) | ||
## [0.1.0](https://github.com/smartiniOnGitHub/fastify-healthcheck/releases/tag/0.1.0) (2018-10-31) | ||
@@ -4,0 +9,0 @@ Summary Changelog: |
@@ -33,8 +33,8 @@ /* | ||
const stream = fs.createReadStream(path.join(scriptRelativeFolder, 'home.html')) | ||
reply.type('text/html').send(stream) | ||
reply.type('text/html; charset=utf-8').send(stream) | ||
}) | ||
fastify.listen(3000, '0.0.0.0', (err) => { | ||
fastify.listen(3000, '0.0.0.0', (err, address) => { | ||
if (err) throw err | ||
console.log(`server listening on ${fastify.server.address().port}`) | ||
console.log(`Server listening on ${address}`) | ||
}) | ||
@@ -41,0 +41,0 @@ |
{ | ||
"name": "fastify-healthcheck", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Fastify Plugin to serve responses for health checks", | ||
@@ -24,6 +24,6 @@ "main": "src/plugin", | ||
"dependencies": { | ||
"fastify-plugin": "^0.2.2" | ||
"fastify-plugin": "^1.2.1" | ||
}, | ||
"devDependencies": { | ||
"fastify": "^0.43.0", | ||
"fastify": "^1.13.0", | ||
"simple-get": "^3.0.3", | ||
@@ -30,0 +30,0 @@ "standard": "^12.0.1", |
# fastify-healthcheck | ||
[](https://npmjs.org/package/fastify-healthcheck/) | ||
[](https://npmjs.org/package/fastify-healthcheck/) | ||
[](http://standardjs.com/) | ||
[](https://coveralls.io/github/smartiniOnGitHub/fastify-healthcheck/?branch=master) | ||
Fastify Plugin to serve responses that report about the web application, | ||
@@ -38,4 +43,7 @@ if it's still running and alive (health checks). | ||
// To test, for example (in another terminal session) do: | ||
// curl http://127.0.0.1:3000/health => returning an HTTP response 200 (OK) | ||
// `curl http://127.0.0.1:3000/health` => returning an HTTP response 200 (OK) | ||
// and a JSON response like: {"statusCode":200,"status":"UP"} | ||
// or run the healthcheck script, for example with: | ||
// `node src/healthcheck http://localhost:3000/health` | ||
// and get the same HTTP response seen before | ||
``` | ||
@@ -53,9 +61,9 @@ | ||
like in the following sequence: | ||
- docker:build, to build the image | ||
- docker:run, to start the container from generated image, in detached mode | ||
- docker:healthcheck-manual, to run the healthcheck script in the container but manually | ||
- docker:status, to get the health status of the container | ||
- and others like: docker:inspect (interactive), docker:log (<CTRL>C to close), docker:process, etc ... | ||
- docker:stop, to stop running container | ||
- docker:clean, to remove generated image | ||
- `docker:build`, to build the image | ||
- `docker:run`, to start the container from generated image, in detached mode | ||
- `docker:healthcheck-manual`, to run the healthcheck script in the container but manually | ||
- `docker:status`, to get the health status of the container | ||
- and others like: `docker:inspect` (interactive), `docker:log` (<CTRL>C to close), `docker:process`, etc ... | ||
- `docker:stop`, to stop running container | ||
- `docker:clean`, to remove generated image | ||
@@ -65,3 +73,3 @@ | ||
Fastify 0.43.0 or later. | ||
Fastify 1.x . | ||
@@ -68,0 +76,0 @@ |
@@ -44,6 +44,6 @@ /* | ||
if (healthcheckUrlAlwaysFail === false) { | ||
reply.type('application/json').send({ statusCode: 200, status: 'UP' }) | ||
reply.send({ statusCode: 200, status: 'UP' }) | ||
} else { | ||
// unless plugin option to always fail is raised | ||
reply.code(500).type('application/json').send({ statusCode: 500, status: 'DOWN' }) | ||
reply.code(500).send({ statusCode: 500, status: 'DOWN' }) | ||
} | ||
@@ -56,4 +56,4 @@ } | ||
module.exports = fp(fastifyHealthchecks, { | ||
fastify: '>=0.43.0', | ||
fastify: '1.x', | ||
name: 'fastify-healthcheck' | ||
}) |
23651
100
+ Addedfastify-plugin@1.6.1(transitive)
+ Addedsemver@6.3.1(transitive)
- Removedfastify-plugin@0.2.2(transitive)
- Removedsemver@5.7.2(transitive)
Updatedfastify-plugin@^1.2.1