Utility to send heartbeat and data information from express.
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>"
}const skadi = require('skadi')With heartbeatUrl in the .skadiconfig.json file, add the following snippet after your imports.
skadi.heartbeat();With osDataUrl in the .skadiconfig.json file, add the following snippet after your imports.
skadi.osdata();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);
});