Express Actuator provides monitoring endpoints based on Spring Boot Actuator and the healthcheck-ping module by Mathias Schreck
npm install express-actuator-healthcheck



This middleware creates a series of endpoints to help you monitor and manage your application when it's pushed to production.
It is based on Spring Boot Actuator and the healthcheck-ping module by Mathias Schreck.
These are the endpoints available:
- /info - Displays application information.
``json`
{
"build": {
"description": "This is my new app",
"name": "MyApp",
"version": "1.0.0"
},
"git": {
"branch": "master",
"commit": {
"id": "329a314",
"time": 1478086940000
}
}
}
`
IMPORTANT: To get this information the middleware have some sort of logic:
1. If the express app is executed with npm start` it will get the data from process.env`
2. If the express app is executed with node app.js` the module will look for a file named package.json where the node command was launched.`
3. Git information will show only if exists a git-properties` file where the app was launched. You can use node-git-info to generate this file.
- /metrics - Shows ‘metrics’ information for the current application.
`json`
{
"mem": {
"heapTotal": 14659584,
"heapUsed": 10615072,
"rss": 30093312
},
"uptime": 19.797
}
`bash`
$ npm install express-actuator-healthcheck --save
`js
var actuator = require('express-actuator');
var app = express();
app.use(actuator());
`
If you want the endpoints to be available on a custom endpoint you can do so:
`js`
app.use(actuator('/management')); // It will set /management/info instead of /info
You have to create a file 'healthcheck.config.yml' in the BFF directory to verify the dependencies external of module.
Example of the YML configuration file:
`js``
checks:
- name: Google
endpoint: http://www.google.com
- name: The New York Time
endpoint: https://www.nytimes.com
- name: Test Fail EndPoint
endpoint: http://testfailendpoint.com