'/heartbeat' endpoint which returns with a JSON if the database connection is established and with a status 500 ('Internal server error') if the connection is down.
npm package manager installed
To install the heartbeat package use $ npm install greenfox-heartbeat --save-dev
in command line. This will automatically add the package to your development dependencies in the package.json file as well.
After installation open config.js
and edit the server info.
Require the package with
let heartbeat = require('./heartbeat')
and insert the '/heartbeat' endpoint
app.get('/heartbeat', heartbeat(connection))