Skip to content

Instantly share code, notes, and snippets.

@denisinla
Forked from nickpoorman/app.coffee
Created August 25, 2014 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denisinla/944a6e537c0e5e655450 to your computer and use it in GitHub Desktop.
Save denisinla/944a6e537c0e5e655450 to your computer and use it in GitHub Desktop.
# if the resource is not found then forward to backbone's router
app.use (req, res) ->
newUrl = req.protocol + '://' + req.get('Host') + '/#' + req.url
res.redirect newUrl
// if the resource is not found then forward to backbone's router
app.use(function(req, res) {
var newUrl = req.protocol + '://' + req.get('Host') + '/#' + req.url;
return res.redirect(newUrl);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment