mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
31 lines
736 B
JavaScript
31 lines
736 B
JavaScript
'use strict';
|
|
|
|
const { Router } = require('express');
|
|
const features = require('./feature.js');
|
|
const metrics = require('./metrics.js');
|
|
const register = require('./register.js');
|
|
|
|
const apiDef = {
|
|
version: 2,
|
|
links: {
|
|
'feature-toggles': { uri: '/api/client/features' },
|
|
register: { uri: '/api/client/register' },
|
|
metrics: { uri: '/api/client/metrics' },
|
|
},
|
|
};
|
|
|
|
exports.apiDef = apiDef;
|
|
|
|
exports.router = config => {
|
|
const router = Router();
|
|
router.get('/', (req, res) => {
|
|
res.json(apiDef);
|
|
});
|
|
|
|
router.use('/features', features.router(config));
|
|
router.use('/metrics', metrics.router(config));
|
|
router.use('/register', register.router(config));
|
|
|
|
return router;
|
|
};
|