mod_statuspageexpress/connect 中间件
mod_statuspage for Node 是简单的 express/connect 中间件,提供一个状态页面,包括 Node.js host 的详细信息。
主要特性:
-
各种版本:Prints NodeJS 版本,OS 版本,OS 发行版
-
CPU - CPU 平均负载
-
Memory内存 - 总内存,剩余内存Total Memory, Free Memory
-
流量 - 总请求数,每秒请求数,总 KBs 传输,总 KBs 输出等等
-
Workers - 所有 worker 进程的列表
安装
npm install mod_statuspage
示例
var express = require('express'),
status = require('../lib/index.js');
var app = express();
app.use(status({
url: '/status',
check: function(req) {
if (req.something == false) {
return false; //Don't show status
}
return true; //Show status
},
responseContentType : 'html'
}));
console.log('Go to: http://127.0.0.1:8000/status');
app.listen(8000);评论
