1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/lib/routes/admin-api/index.js
Christopher Kolstad 43801f1f13
Add Tags and tag types
- First iteration of api for tags and tag-types
- Documentation in place
- Adds three new tables
   - tag_types
   - tags
   - feature_tag
- Tagging a feature is adding a row in the feature_tag
  join table

* #665

Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
2021-01-14 13:09:05 +01:00

67 lines
2.1 KiB
JavaScript

'use strict';
const Controller = require('../controller');
const FeatureController = require('./feature.js');
const FeatureTypeController = require('./feature-type.js');
const ArchiveController = require('./archive.js');
const EventController = require('./event.js');
const StrategyController = require('./strategy');
const MetricsController = require('./metrics');
const UserController = require('./user');
const ConfigController = require('./config');
const ContextController = require('./context');
const StateController = require('./state');
const TagController = require('./tag');
const TagTypeController = require('./tag-type');
const apiDef = require('./api-def.json');
class AdminApi extends Controller {
constructor(config, services) {
super(config);
this.app.get('/', this.index);
this.app.use(
'/features',
new FeatureController(config, services).router,
);
this.app.use(
'/feature-types',
new FeatureTypeController(config, services).router,
);
this.app.use(
'/archive',
new ArchiveController(config, services).router,
);
this.app.use(
'/strategies',
new StrategyController(config, services).router,
);
this.app.use('/events', new EventController(config, services).router);
this.app.use(
'/metrics',
new MetricsController(config, services).router,
);
this.app.use('/user', new UserController(config, services).router);
this.app.use(
'/ui-config',
new ConfigController(config, services).router,
);
this.app.use(
'/context',
new ContextController(config, services).router,
);
this.app.use('/state', new StateController(config, services).router);
this.app.use('/tags', new TagController(config, services).router);
this.app.use(
'/tag-types',
new TagTypeController(config, services).router,
);
}
index(req, res) {
res.json(apiDef);
}
}
module.exports = AdminApi;