Skip to content

Instantly share code, notes, and snippets.

@jmar777
Created March 8, 2011 17:32
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 jmar777/860616 to your computer and use it in GitHub Desktop.
Save jmar777/860616 to your computer and use it in GitHub Desktop.
ServerRequest parsedUrl Expando
var _parsedUrl;
Object.defineProperty(req, 'parsedUrl', {
get: function() {
if (!_parsedUrl) {
_parsedUrl = url.parse(req.url, true);
}
return _parsedUrl;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment