skadi-hammerio

Utility to send heartbeat and data information from express.

Usage no npm install needed!

<script type="module">
  import skadiHammerio from 'https://cdn.skypack.dev/skadi-hammerio';
</script>

README

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);
});