项目作者: fukuiretu

项目描述 :
Nuxt.js module for handle healthcheck
高级语言: JavaScript
项目地址: git://github.com/fukuiretu/nuxt-healthcheck.git
创建时间: 2018-06-28T00:08:29Z
项目社区:https://github.com/fukuiretu/nuxt-healthcheck

开源协议:

下载


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

  1. module.exports = {
  2. modules: [
  3. 'nuxt-healthcheck',
  4. ]
  5. }

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

  1. healthcheck: {
  2. path: '/ping',
  3. contentType: 'application/json',
  4. healthy: () => {
  5. return JSON.stringify({ result: 'pong' })
  6. }
  7. }

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.