
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
feathers-alive-ready
Advanced tools
feathersjs health check endpoints
a plugin to add health check endpoints to a feathersjs application
// install peer dependencies
npm install --save @feathersjs/errors @feathersjs/express @feathersjs/feathers
// install module
npm install --save feathers-alive-ready
// default.json
// add any number of arbitrary keys here, mongoose is just an example
{
"readiness": {
"mongoose": false
}
}
import feathers from '@feathersjs/feathers';
import { health } from 'feathers-alive-ready';
import mongoose from './mongoose';
// Initialize the application
const app = feathers();
// Initialize the plugin before all other services that may require
// a health check
app.configure(health());
app.configure(mongoose);
What happens in step 2
By default, the plugin will add two endponts /health/alive
and /health/ready
to the application.
Use the helper method below to tell the application your service is now ready
// ./mongoose.ts
import { setReady } from 'feathers-alive-ready';
export default function (app: Application) {
mongoose
.connect(app.get('mongodb'), {
useCreateIndex: true,
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => {
setReady(app, 'mongoose');
})
.catch((err) => {
logger.error(err);
process.exit(1);
});
mongoose.Promise = global.Promise;
app.set('mongooseClient', mongoose);
}
The ready
endpoint will not return a positive result until all keys in the readiness
config are truthy
You can customize the plugin by passing in options.
Property | default | description |
---|---|---|
configKey | readiness | which property to look for the readiness config in the app config files |
returnData | false | determines if to return the readiness object in the ready endpoint |
aliveUrl | /health/alive | alive endpoint |
readyUrl | /health/ready | ready endpoint |
customOnly | false | will only honour custom checks when set to true, if false will honour both readiness config + custom checks |
custom | [] | an array of functions that return a boolean eg. [(app) => true] |
app.configure(
health({
configKey: 'readiness',
returnData: true,
aliveUrl: '/health/alive',
readyUrl: '/health/ready',
}),
);
If you want to do your own custom checks then do the following
app.configure(
health({
customOnly: true,
custom: [(app: Application) => !!app.get('mongooseClient')],
}),
);
Licensed under the MIT license.
FAQs
feathersjs health check endpoints
We found that feathers-alive-ready demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.