New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chairo-health-check

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chairo-health-check

A Chairo plugin that adds a health check action to expose basic service information

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

chairo-health-check

npm version Build Status Coverage Status NSP Status

Add a simple health check to your chairo/seneca service. Includes the ability to check which version of your service is running.

Usage
const Chairo = require('chairo')
const HealthCheck = require('chairo-health-check')
const { name, version } = require('./package.json')

const HealthCheckPlugin = {
  register: HealthCheck,
  options: {
    name, // Optional. Default: $npm_package_name
    version, // Optional. Default: $npm_package_version
    action: {  // Optional. Default shown here
      role: 'health',
      cmd: 'check',
    },
    promise: Promise.resolve('testing'),
  },
}

server.register([Chairo, HealthCheckPlugin], (error) => {

  if (error) return server.log(['error'], error)

  return server.start(() => {

    server.log(['info'], `Server running at: ${server.info.uri}`)

  })

})

Example result:

{
  "info": {
    "created": 1476044745024,
    "started": 0,
    "host": "mylaptop.local",
    "port": 0,
    "protocol": "http",
    "id": "mylaptop.local:61289:iu32xidc",
    "uri": "http://mylaptop.local"
  },
  "name": "my-seneca-service",
  "ready": true,
  "version": "1.0.0",
  "promise": "testing"
}
Options

The following configuration options are available:

  • name - The name to be returned from the health check. Default: process.env.npm_package_name
  • version - The version to be returned from the health check. Default: process.env.npm_package_version
  • action - The pattern used to call the health check. Default: { role: 'health', cmd: 'check }
  • promise - A promise to be resolved and the returned value added to a promise property on the result message.

Keywords

FAQs

Package last updated on 18 Oct 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc