1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/lib/routes/backstage.js

20 lines
505 B
JavaScript
Raw Normal View History

'use strict';
2017-06-28 14:21:05 +02:00
const { register: prometheusRegister } = require('prom-client');
const Controller = require('./controller');
class BackstageController extends Controller {
constructor(config) {
super();
if (config.serverMetrics) {
this.get('/prometheus', (req, res) => {
res.set('Content-Type', prometheusRegister.contentType);
res.end(prometheusRegister.metrics());
});
}
}
}
module.exports = BackstageController;