|
|
|
@ -244,7 +244,7 @@ var nconf = require('nconf'),
|
|
|
|
|
|
|
|
|
|
var custom_routes = {
|
|
|
|
|
'routes': [],
|
|
|
|
|
'api_methods': []
|
|
|
|
|
'api': []
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
plugins.ready(function() {
|
|
|
|
@ -264,6 +264,19 @@ var nconf = require('nconf'),
|
|
|
|
|
}(route));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var apiRoutes = custom_routes.api;
|
|
|
|
|
for (var route in apiRoutes) {
|
|
|
|
|
if (apiRoutes.hasOwnProperty(route)) {
|
|
|
|
|
(function(route) {
|
|
|
|
|
app[apiRoutes[route].method || 'get']('/admin/api' + apiRoutes[route].route, function(req, res) {
|
|
|
|
|
apiRoutes[route].callback(req, res, function(data) {
|
|
|
|
|
res.json(data);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}(route));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|