Skip to content

Instantly share code, notes, and snippets.

@abhijitkane
Created July 20, 2016 09:45
Show Gist options
  • Save abhijitkane/2ce1937bb33ec7f78a88d642740e78c9 to your computer and use it in GitHub Desktop.
Save abhijitkane/2ce1937bb33ec7f78a88d642740e78c9 to your computer and use it in GitHub Desktop.
Resolving values in scripts
var url = request.url;
_.forIn(environment, function(index, key) {
url = url.replace(new RegExp("{{"+key+"}}", 'g'), environment[key]);
});
console.log(url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment