nvsr

0.0.3 • Public • Published

Node Vip Status Responser

处理淘宝 vip 7层健康度检查请求

  • 支持原生 http module 与 connect middleware
  • 提供命令行工具可强制指定vip状态开关
var nvsr = new require('nvsr')({
    // health check function
    check_health: function(done){
        ... // do health check
        err = gotError ? new Error() : null
        done(err)
    },
    // listen stat switch sock for command line
    sock_path: "http-nvsr.sock"
    // health check timeout ms
    timeout : 500
})
// with http
var http = http.createServer(function(req, resp){
    nvsr.status(req, resp, function(req, resp){
        // you own codes
    })
})
 
// with connect
app.use nvsr.status

Readme

Keywords

none

Package Sidebar

Install

npm i nvsr

Weekly Downloads

1

Version

0.0.3

License

none

Last publish

Collaborators

  • q3boy