0.0.3 • Published 13 years ago

nvsr v0.0.3

Weekly downloads
12
License
-
Repository
gitlab
Last release
13 years ago

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
0.0.3

13 years ago

0.0.1

13 years ago