Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
rutilus-apiheartbeat-node
Advanced tools
Makes constant requests to urls and logs whether the response was successful and the response time. Can be configured to throw errors if the response fails in order to crash containers.
This module makes constant requests to urls and logs whether the response was successful and the response time.
The module can be set to throw errors if the URL does not respond in order to crash containers.
Example: if we are deploying a cluster of containers with several APIs and want to make sure all the APIs are responding properly, we can set up this module to watch all the APIs and throw an error to crash the container (which will be restarted) in case one of them stops responding.
This module does not have dependencies.
npm install rutilus_apiheartbeat_node --save
Require the module in the project and call it by passing 2 parameters, the last one being optional:
An array of objects that describe the APIs to be monitored:
[
{
title: String (optional, defaults to "Untitled"),
address: String,
useHttps: true (optional, defaults to "false"),
logDirectory: '/logs' (optional, defaults to ""),
logFile: String,
timeSpan: Number (optional, defaults to "10000"),
maxFileSizeBytes: Number (optional, defaults to "10000000"),
crashWhenFail: Boolean (optional, defaults to "false"),
}
]
A number that delays the start of the heartbeat. Example: 10000 (for 10 seconds)
const APIHeartbeat = require('rutilus_apiheartbeat_node');
APIHeartbeat([{
title: 'My API 1',
address: 'https://www.api1.com/',
useHttps: true,
logDirectory: '/logs',
logFile: 'api1.log',
timeSpan: 10000,
maxFileSizeBytes: 1000000,
crashWhenFail: true,
}, {
title: 'My API 2',
address: 'http://www.api2.com:3000/',
useHttps: false,
logDirectory: '/logs/api2',
logFile: 'api2.log',
timeSpan: 60000,
}], 5000);
FAQs
Makes constant requests to urls and logs whether the response was successful and the response time. Can be configured to throw errors if the response fails in order to crash containers.
We found that rutilus-apiheartbeat-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.