|
|
|
@ -12,18 +12,11 @@ var nconf = require('nconf'),
|
|
|
|
|
pluginRoutes = require('./plugins');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function(app, middleware) {
|
|
|
|
|
app.namespace(nconf.get('relative_path'), function() {
|
|
|
|
|
adminRoutes(app, middleware, controllers);
|
|
|
|
|
metaRoutes(app, middleware, controllers);
|
|
|
|
|
apiRoutes(app, middleware, controllers);
|
|
|
|
|
feedRoutes(app, middleware, controllers);
|
|
|
|
|
pluginRoutes(app, middleware, controllers);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Every view has an associated API route.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
/**
|
|
|
|
|
* Every view has an associated API route.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
function mainRoutes(app, middleware, controllers) {
|
|
|
|
|
/* Main */
|
|
|
|
|
app.get('/', middleware.buildHeader, controllers.home);
|
|
|
|
|
app.get('/api/home', controllers.home);
|
|
|
|
@ -121,9 +114,22 @@ module.exports = function(app, middleware) {
|
|
|
|
|
|
|
|
|
|
app.get('/users/search', middleware.buildHeader, middleware.checkGlobalPrivacySettings, controllers.users.getUsersForSearch);
|
|
|
|
|
app.get('/api/users/search', middleware.checkGlobalPrivacySettings, controllers.users.getUsersForSearch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function(app, middleware) {
|
|
|
|
|
app.namespace(nconf.get('relative_path'), function() {
|
|
|
|
|
adminRoutes(app, middleware, controllers);
|
|
|
|
|
|
|
|
|
|
plugins.ready(function() {
|
|
|
|
|
app.all('/api/*', middleware.updateLastOnlineTime, middleware.prepareAPI);
|
|
|
|
|
plugins.fireHook('action:app.load', app, middleware, controllers);
|
|
|
|
|
|
|
|
|
|
metaRoutes(app, middleware, controllers);
|
|
|
|
|
apiRoutes(app, middleware, controllers);
|
|
|
|
|
feedRoutes(app, middleware, controllers);
|
|
|
|
|
pluginRoutes(app, middleware, controllers);
|
|
|
|
|
mainRoutes(app, middleware, controllers);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
|