Skip to content

Instantly share code, notes, and snippets.

@dmikey
Created June 1, 2017 17:05
Show Gist options
  • Save dmikey/05b72f48e7d32b8a653eb97fe858e341 to your computer and use it in GitHub Desktop.
Save dmikey/05b72f48e7d32b8a653eb97fe858e341 to your computer and use it in GitHub Desktop.
module.exports = function(uri) {
// returns protocol://hostname:port/
var a = document.createElement('a');
a.href = endPoints.host;
return a.protocol + '//' + a.host + ':' + (a.port.length > 0 ? a.port : '80') +'/';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment