title: Node.js and undefined properties
body: <p>I'm trying to use GET variables to transfer some simple data but for some reason I'm doing it wrong.</p>
  
  <p>My code is pretty simple. I use Node.js HTTP &amp; URL libraries. When I try to run following code, I get TypeError: Cannot read property 'foo' of undefined. I really don't understand why because foo is passed in the URL and if I do console.log to q object, there's foo value.</p>
  
  <pre><code>http.createServer(function (req, res) {
     res.writeHead(200, {'Content-Type': 'text/plain'})
     var vars = url.parse(req.url,true)
     var q = vars.query
     if(q.foo) {
        res.end('yay')
     } else res.end('snif')
   }).listen(8000,"127.0.0.1")
  </code></pre>