|
|
@ -13,9 +13,7 @@ var path = require('path'),
|
|
|
|
meta = require('./../meta'),
|
|
|
|
meta = require('./../meta'),
|
|
|
|
plugins = require('./../plugins'),
|
|
|
|
plugins = require('./../plugins'),
|
|
|
|
utils = require('./../../public/src/utils'),
|
|
|
|
utils = require('./../../public/src/utils'),
|
|
|
|
pkg = require('./../../package.json'),
|
|
|
|
pkg = require('./../../package.json');
|
|
|
|
|
|
|
|
|
|
|
|
customTemplates = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function searchTerm(req, res, next) {
|
|
|
|
function searchTerm(req, res, next) {
|
|
|
@ -137,7 +135,7 @@ function getModerators(req, res, next) {
|
|
|
|
|
|
|
|
|
|
|
|
function getTemplatesListing(req, res, next) {
|
|
|
|
function getTemplatesListing(req, res, next) {
|
|
|
|
utils.walk(nconf.get('views_dir'), function (err, data) {
|
|
|
|
utils.walk(nconf.get('views_dir'), function (err, data) {
|
|
|
|
data = data.concat(customTemplates)
|
|
|
|
data = data.concat(require('./plugins').getCustomTemplates())
|
|
|
|
.filter(function(value, index, self) {
|
|
|
|
.filter(function(value, index, self) {
|
|
|
|
return self.indexOf(value) === index;
|
|
|
|
return self.indexOf(value) === index;
|
|
|
|
}).map(function(el) {
|
|
|
|
}).map(function(el) {
|
|
|
@ -152,8 +150,6 @@ module.exports = function(app, middleware, controllers) {
|
|
|
|
app.namespace('/api', function () {
|
|
|
|
app.namespace('/api', function () {
|
|
|
|
app.all('*', middleware.updateLastOnlineTime, middleware.prepareAPI);
|
|
|
|
app.all('*', middleware.updateLastOnlineTime, middleware.prepareAPI);
|
|
|
|
|
|
|
|
|
|
|
|
customTemplates = app.get_custom_templates();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/config', controllers.api.getConfig);
|
|
|
|
app.get('/config', controllers.api.getConfig);
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/user/uid/:uid', middleware.checkGlobalPrivacySettings, controllers.accounts.getUserByUID);
|
|
|
|
app.get('/user/uid/:uid', middleware.checkGlobalPrivacySettings, controllers.accounts.getUserByUID);
|
|
|
|