2017-06-28 10:20:22 +02:00
|
|
|
'use strict';
|
|
|
|
|
2018-11-30 10:11:36 +01:00
|
|
|
const Controller = require('../controller');
|
2018-11-30 11:11:12 +01:00
|
|
|
const FeatureController = require('./feature.js');
|
2018-11-30 08:24:22 +01:00
|
|
|
const ArchiveController = require('./archive.js');
|
2018-11-30 10:11:36 +01:00
|
|
|
const EventController = require('./event.js');
|
2018-12-05 21:07:45 +01:00
|
|
|
const StrategyController = require('./strategy');
|
2018-12-04 08:50:45 +01:00
|
|
|
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');
|
2019-03-13 19:10:13 +01:00
|
|
|
const StateController = require('./state');
|
2018-11-29 21:25:45 +01:00
|
|
|
const apiDef = require('./api-def.json');
|
|
|
|
|
2018-11-30 10:11:36 +01:00
|
|
|
class AdminApi extends Controller {
|
2018-11-29 21:25:45 +01:00
|
|
|
constructor(config) {
|
2018-12-19 14:50:01 +01:00
|
|
|
super(config);
|
2018-11-29 21:25:45 +01:00
|
|
|
|
2018-11-30 10:11:36 +01:00
|
|
|
this.app.get('/', this.index);
|
2018-12-19 14:50:01 +01:00
|
|
|
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);
|
2019-03-13 19:10:13 +01:00
|
|
|
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;
|