pingoo
v1.1.1
Published
A small library which provide a ping endpoint based on the stock HTTP module from Node.JS.
Downloads
6
Maintainers
Readme
Pingoo
A small library which provide a ping endpoint based on the stock HTTP module from Node.JS.
Installation
$ npm install pingoo --save
Usage
const pingoo = require('pingoo')
const ping = pingoo()
Advanced Usage
const pingoo = require('pingoo')
const options = {
port: 7337,
route: 'ping'
}
const ping = pingoo(options)
Ping endpoint
Should return something like this:
{
"name": "myapp",
"version": "1.0.0",
"status": "OK",
"statusCode": "200",
"time": "2018-02-05T17:22:33.486Z",
"process": {
"uptime": 10.198,
"title": "npm",
"version": "8.9.4",
"pid": 4472
}
}
Test
You should run the test.js
script with dev dependencies installed.
The test script runs the endpoint on port 4433 on the route /health and then uses the got
module to access it.
Release History
- 1.1.0 Added debug function and fixed bug (yes it's possible even with 2 lines of code ^^)
- 1.0.1 More expressive README
- 1.0.0 Initial release