Add /__version__ route
This commit is contained in:
parent
2691dfcf2f
commit
2b01bb75dc
3 changed files with 43 additions and 6 deletions
|
@ -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}!`);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue