|
|
@ -45,7 +45,7 @@ app.use(flash());
|
|
|
|
var dash = require('./routes/dash/index');
|
|
|
|
var dash = require('./routes/dash/index');
|
|
|
|
var page = require('./routes/dash/pages');
|
|
|
|
var page = require('./routes/dash/pages');
|
|
|
|
var settings = require('./routes/dash/settings');
|
|
|
|
var settings = require('./routes/dash/settings');
|
|
|
|
//var navDashboard = require('./routes/dash/nav');
|
|
|
|
var nav = require('./routes/dash/nav');
|
|
|
|
//api
|
|
|
|
//api
|
|
|
|
var pages = require('./api/v1/pages');
|
|
|
|
var pages = require('./api/v1/pages');
|
|
|
|
var setting = require('./api/v1/settings');
|
|
|
|
var setting = require('./api/v1/settings');
|
|
|
@ -58,11 +58,10 @@ app.use('/api/v1/settings', setting);
|
|
|
|
//app.use('/api/mail', mailer);
|
|
|
|
//app.use('/api/mail', mailer);
|
|
|
|
app.use('/api/v1/auth', auth);
|
|
|
|
app.use('/api/v1/auth', auth);
|
|
|
|
// PAGES
|
|
|
|
// PAGES
|
|
|
|
//app.use('/', front);
|
|
|
|
|
|
|
|
app.use('/@/dashboard', dash);
|
|
|
|
app.use('/@/dashboard', dash);
|
|
|
|
app.use('/@/dashboard/page', page);
|
|
|
|
app.use('/@/dashboard/page', page);
|
|
|
|
app.use('/@/dashboard/settings', settings);
|
|
|
|
app.use('/@/dashboard/settings', settings);
|
|
|
|
//app.use('/@/dashboard/navigation', navDashboard);
|
|
|
|
app.use('/@/dashboard/navigation', nav);
|
|
|
|
//app.use('/mailer', mailer);
|
|
|
|
//app.use('/mailer', mailer);
|
|
|
|
// catch 404 and forward to error handler
|
|
|
|
// catch 404 and forward to error handler
|
|
|
|
app.use(function(req, res, next) {
|
|
|
|
app.use(function(req, res, next) {
|
|
|
@ -76,7 +75,7 @@ app.use(function(req, res, next) {
|
|
|
|
if (app.get('env') === 'development') {
|
|
|
|
if (app.get('env') === 'development') {
|
|
|
|
app.use(function(err, req, res) {
|
|
|
|
app.use(function(err, req, res) {
|
|
|
|
res.status(err.status || 500);
|
|
|
|
res.status(err.status || 500);
|
|
|
|
res.render(theme + '/error', {
|
|
|
|
res.render('error', {
|
|
|
|
message: err.message,
|
|
|
|
message: err.message,
|
|
|
|
error: err
|
|
|
|
error: err
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -86,7 +85,7 @@ if (app.get('env') === 'development') {
|
|
|
|
// no stacktraces leaked to user
|
|
|
|
// no stacktraces leaked to user
|
|
|
|
app.use(function(err, req, res) {
|
|
|
|
app.use(function(err, req, res) {
|
|
|
|
res.status(err.status || 500);
|
|
|
|
res.status(err.status || 500);
|
|
|
|
res.render(theme + '/error', {
|
|
|
|
res.render('error', {
|
|
|
|
message: err.message,
|
|
|
|
message: err.message,
|
|
|
|
error: {}
|
|
|
|
error: {}
|
|
|
|
});
|
|
|
|
});
|
|
|
|