Skip to content

Instantly share code, notes, and snippets.

@kitek
Created November 29, 2011 12:36
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 kitek/1404664 to your computer and use it in GitHub Desktop.
Save kitek/1404664 to your computer and use it in GitHub Desktop.
Parsowanie parametrów GET
var qs = require('querystring');
req.on('end', function () {
var url = req.url.substr(1), qmPos = url.indexOf('?'), getParams = {};
if(qmPos > 0) {
getParams = qs.parse(url.substr(qmPos+1));
url = url.substr(0, qmPos);
}
console.log(url);
console.log(getParams);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment