Merge pull request #363 from FreeCodeCamp/root

Root
This commit is contained in:
Nathan
2015-04-24 19:16:43 -04:00
20 changed files with 208 additions and 262 deletions

9
app.js
View File

@@ -85,11 +85,12 @@ console.log(process.env.NODE_ENV);
if (process.env.NODE_ENV === 'production') {
app.all(/.*/, function (req, res, next) {
var host = req.header("host");
var host = req.header('host');
var originalUrl = req['originalUrl'];
if (host.match(/^www\..*/i)) {
next();
} else {
res.redirect(301, "http://www." + host);
res.redirect(301, "http://www." + host + originalUrl);
}
});
}
@@ -297,9 +298,9 @@ app.get('/nodeschool-challenges', function(req, res) {
app.get('/news', function(req, res) {
res.redirect(301, '/stories/hot');
});
app.get('/learn-to-code', resourcesController.about);
app.get('/learn-to-code', challengeMapController.challengeMap);
app.get('/about', function(req, res) {
res.redirect(301, '/learn-to-code');
res.redirect(301, '/map');
});
app.get('/signin', userController.getSignin);