Skip to content

Instantly share code, notes, and snippets.

@robksawyer
Created October 22, 2014 07:08
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 robksawyer/062a72fdf5b215181a3e to your computer and use it in GitHub Desktop.
Save robksawyer/062a72fdf5b215181a3e to your computer and use it in GitHub Desktop.
Returns the referring view in SailsJS.
//Returns just the referring view. This can be used in the res.redirect or res.view.
var referrer = req.header('Referer').replace(req.protocol + "://" + req.host + ":" + req.port + '/', '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment