From 387091c5c9f15bb39075ebfaedd0239cd3c29416 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 27 Oct 2013 18:11:50 +0100 Subject: [PATCH] Expose current stats at /stats --- src/node/hooks/express/specialpages.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index 440024614..6701726e4 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -2,6 +2,10 @@ var path = require('path'); var eejs = require('ep_etherpad-lite/node/eejs'); exports.expressCreateServer = function (hook_name, args, cb) { + // expose current stats + args.app.get('/stats', function(req, res) { + res.json(require('ep_etherpad-lite/node/stats').toJSON()) + }) //serve index.html under / args.app.get('/', function(req, res)