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

45 lines
1.2 KiB
JavaScript
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
const { Router } = require('express');
const adminApi = require('./admin-api');
const clientApi = require('./client-api');
const clientFeatures = require('./client-api/feature.js');
const health = require('./health-check');
const backstage = require('./backstage.js');
exports.router = function(config) {
const router = Router();
router.use('/health', health.router(config));
router.use('/internal-backstage', backstage.router(config));
router.get('/api', (req, res) => {
res.json({
version: 2,
links: {
admin: {
uri: '/api/admin',
links: adminApi.apiDef.links,
},
client: {
uri: '/api/client',
links: clientApi.apiDef.links,
},
},
});
});
router.use('/api/admin', adminApi.router(config));
router.use('/api/client', clientApi.router(config));
// legacy support
// $root/features
// $root/client/register
// $root/client/metrics
router.use('/api/features', clientFeatures.router(config));
return router;
2016-04-28 16:58:59 +02:00
};