Fixed linting errors and webpack config for redirect routes.

This commit is contained in:
Shane M. Clements 2016-04-09 10:39:55 -06:00
parent cbc58d2f11
commit a6be92448b
3 changed files with 6 additions and 5 deletions

View file

@ -20,7 +20,8 @@
"formatMessage": true "formatMessage": true
}, },
"ecmaFeatures": { "ecmaFeatures": {
"jsx": true "jsx": true,
"arrowFunctions": true
}, },
"plugins": [ "plugins": [
"react" "react"

View file

@ -3,7 +3,6 @@ var defaults = require('lodash.defaults');
var fs = require('fs'); var fs = require('fs');
var mustache = require('mustache'); var mustache = require('mustache');
var path = require('path'); var path = require('path');
var config = require('./config'); var config = require('./config');
/** /**
@ -12,8 +11,8 @@ var config = require('./config');
function Handler (route) { function Handler (route) {
// Handle redirects // Handle redirects
if (route.redirect) { if (route.redirect) {
return (req, res) => res.redirect(route.redirect); return (req, res) => { res.redirect(route.redirect); };
} }
// Route definition // Route definition
defaults(route, config); defaults(route, config);

View file

@ -9,7 +9,8 @@ var entry = {
init: './src/init.js' init: './src/init.js'
}; };
routes.forEach(function (route) { routes.forEach(function (route) {
entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx'; if (!route.redirect)
entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx';
}); });
// Config // Config