0.0.1 • Published 6 years ago

skadi-hammerio v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

skadi

Utility to send heartbeat and data information from express.

Build Status

Setup

Create a .skadiconfig.json file in the directory where you are launching your application from.

{
    "interval": "<optional interval in millisecnods>",
    "apiKey": "<apiKey from koma>",
    "heartbeatUrl": "<server url to koma heartbeats>",
    "osDataUrl": "<server url to koma os data>",
    "httpDataUrl": "<server url to koma http data>"
}

Usage

const skadi = require('skadi')

Heartbeat

With heartbeatUrl in the .skadiconfig.json file, add the following snippet after your imports.

skadi.heartbeat();

OS Data

With osDataUrl in the .skadiconfig.json file, add the following snippet after your imports.

skadi.osdata();

HTTP Data

To capture incoming requests, add the following snippet before your routes.

app.use((req, res, next) => {
  skadi.captureRequestData(req);
  next();
});

To capture outgoing responses, add the following snippet after your routes.

app.use((req, res, next) => {
  skadi.captureResponseData(req, res);
});