Skip to content

Instantly share code, notes, and snippets.

@Tim-Machine
Created August 14, 2015 12:52
Show Gist options
  • Select an option

  • Save Tim-Machine/873014475623a3c6f403 to your computer and use it in GitHub Desktop.

Select an option

Save Tim-Machine/873014475623a3c6f403 to your computer and use it in GitHub Desktop.
FlowRouter.route('/home', {
// calls just before the action
triggersEnter: [setSite],
action: function() {
// do something you like
});
setSite = function(){
var url = window.location.hostname;
var urlBits = url.split('.');
//example hostnamedocs.meteor.com
// urlBits[0] || subdomain
// urlBits[1] || domain
// urlBits[2] || domain extention
// set some session vals from this
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment