https://github.com/maxdome/mxd-healthcheck
Provide healthcheck routes for load balancers and debugging
https://github.com/maxdome/mxd-healthcheck
Last synced: about 1 year ago
JSON representation
Provide healthcheck routes for load balancers and debugging
- Host: GitHub
- URL: https://github.com/maxdome/mxd-healthcheck
- Owner: maxdome
- Created: 2016-06-15T11:33:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-11T09:47:33.000Z (over 8 years ago)
- Last Synced: 2025-04-17T09:52:23.701Z (about 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example
```
const { checkhelper, healthcheck } = require('mxd-healthcheck')(config, app);
const services = {};
healthcheck(services);
```
# Services
List of check functions for the external services
```
const service = (callback) => {
if (/* check if the external dependency is available like needed */) {
callback();
} else {
callback(/* reason why the external dependency is not OK */);
}
}
```
# checkhelpers
Check functions for some common external services
## BBE (= MMW)
```
const service = checkhelper.bbe(/* connection config */);
```
## Healthcheck App (= Bifrost, Heimdall, Skidbladnir)
```
const service = checkhelper.healthcheckApp(/* connection config */);
```
## Interfacemanager (= MMW-Proxy, = API)
```
const service = checkhelper.interfacemanager(/* connection config */);
```
## Redis
```
const service = checkhelper.redis(client, { read: true, write: true });
```
# Routes
* `/health/app`: response only the status of the app without checking the external services
* `/health/details`: response the reason instead of `ERROR` for the external serives
* `/health/summary`: response only the status of the external services with `OK` and `ERROR`