Add /__version__ route

This commit is contained in:
Peter deHaan 2017-06-23 11:29:45 -07:00
parent 2691dfcf2f
commit 2b01bb75dc
No known key found for this signature in database
GPG key ID: F0FC6C01C6305097
3 changed files with 43 additions and 6 deletions

View file

@ -7,6 +7,9 @@ const helmet = require('helmet');
const bytes = require('bytes');
const conf = require('./config.js');
const storage = require('./storage.js');
const pkg = require('../package.json');
const gitSHA = require('git-rev-sync').short();
const notLocalHost = conf.notLocalHost;
@ -150,6 +153,14 @@ app.get('/__lbheartbeat__', (req, res) => {
res.sendStatus(200);
});
app.get('/__version__', (req, res) => {
res.json({
commit: gitSHA,
source: pkg.homepage,
version: pkg.version
});
});
app.listen(conf.listen_port, () => {
log.info('startServer:', `Portal app listening on port ${conf.listen_port}!`);
});