redirect regardless of environment :P

This commit is contained in:
2011-12-25 01:48:17 +00:00
parent bc9795fc47
commit b76a218f99
2 changed files with 15 additions and 12 deletions

View File

@@ -8,6 +8,12 @@ app.configure ->
app.set 'views', __dirname + '/views'
app.set 'view engine', 'coffee'
app.register '.coffee', require('coffeekup').adapters.express
app.use (req, res, next) ->
console.log "Hostname: %s", req.header('Host')
if req.header('Host') == 'www.heartb.it'
res.redirect('http://heartb.it/')
else
next()
app.use express.bodyParser()
app.use express.methodOverride()
app.use express.static(__dirname + '/public')
@@ -17,13 +23,6 @@ app.configure 'development', ->
app.configure 'production', ->
app.use express.errorHandler
app.use (req, res, next) ->
console.log "Hostname: %s", req.header('Host')
next()
# if req.header('Host') == 'www.heartb.it'
# res.redirect('http://heartb.it/')
# else
# next()
# Routes