目录

egg-status

egg application “Health Checker”

Install

npm i egg-status

Usage

Enable egg-status plugin on config/plugin.ts.

export default {
  status: {
    package: 'egg-status',
    enable: true,
  },
}

Use egg-scripts deploy your egg application.

Firstly, we need to import egg-scripts as dependencies:

npm i egg-scripts

Then add npm scripts to package.json, create egg.status file after start and remove it before stop:

{
  "scripts": {
    "start": "egg-scripts start --daemon && touch egg.status",
    "stop": "rm -f egg.status && sleep 15 && egg-scripts stop"
  }
}

Set “Health Check” on SLB, example on alicloud

image

How to Contribute

Please let us know how can we help. Do check out issues for bug reports or suggestions first.

To become a contributor, please follow our contributing guide.

License

MIT

关于
39.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号