Returns common info about fastify server. Could be used for healthchecks and status monitoring.
npm i fastify-status --saveExample with default plugin options.
const fastify = require('fastify');
const statusPlugin = require('fastify-status');
const app = fastify();
app.register(statusPlugin, {
info: '/__info__',
alive: '/__alive__',
});Use alive for healthchecks and info to get information and some stats of your server.
If info or alive is not present in config, then apropriate route will not be added.
{
uptime: '0d 0h 0m 10s',
memory: {
rss: '50Mb',
external: '40Mb',
heapTotal: '30Mb',
heapUsed: '20Mb',
},
start: '2020-05-10T07:41:20.389Z',
env: 'test',
name: 'my-server',
version: '1.0.0',
node: 'v14.0.0'
}See changelog.
- under-pressure - more advanced healthcheck.
Licensed under MIT.
