1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/lib/routes/admin-api/index.js

35 lines
1.2 KiB
JavaScript
Raw Normal View History

'use strict';
const Controller = require('../controller');
const FeatureController = require('./feature.js');
const ArchiveController = require('./archive.js');
const EventController = require('./event.js');
const StrategyController = require('./strategy');
const MetricsController = require('./metrics');
2018-12-04 08:16:03 +01:00
const UserController = require('./user');
2019-03-12 10:46:08 +01:00
const ConfigController = require('./config');
const StateController = require('./state');
2018-11-29 21:25:45 +01:00
const apiDef = require('./api-def.json');
class AdminApi extends Controller {
2018-11-29 21:25:45 +01:00
constructor(config) {
super(config);
2018-11-29 21:25:45 +01:00
this.app.get('/', this.index);
this.app.use('/features', new FeatureController(config).router);
this.app.use('/archive', new ArchiveController(config).router);
this.app.use('/strategies', new StrategyController(config).router);
this.app.use('/events', new EventController(config).router);
this.app.use('/metrics', new MetricsController(config).router);
this.app.use('/user', new UserController(config).router);
2019-03-12 10:46:08 +01:00
this.app.use('/ui-config', new ConfigController(config).router);
this.app.use('/state', new StateController(config).router);
2018-11-29 21:25:45 +01:00
}
index(req, res) {
res.json(apiDef);
}
}
module.exports = AdminApi;