nuxt-healthcheck

Middreware for Nuxt.js that provides healthcheck.
156,885 38
Install
npm install nuxt-healthcheck
Latest Version:1.0.1
License:MIT
Last Updated:Jun 29, 2018
Links: GitHub  ·  npm
Maintainer: fukuiretu

nuxt-healthcheck

Middreware for Nuxt.js that provides healthcheck.

Setup

Install with yarn:

yarn add nuxt-healthcheck

Install with npm:

npm install nuxt-healthcheck

Add nuxt-healthcheck module to nuxt.config.js

module.exports = {
  modules: [
    'nuxt-healthcheck',
  ]
}

Add additional options to healthcheck section of nuxt.config.js to override defaults

healthcheck: {
  path: '/ping',
  contentType: 'application/json',
  healthy: () => {
    return JSON.stringify({ result: 'pong' })
  }
}

Options

path

Default: '/healthcheck'

contentType

Default: 'text/plain'

healthy

Function that returns a response body.

Default: 'OK'

TODO

  • unit test

License

The npm is available as open source under the terms of the MIT License.

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT