title: NodeJS - WITHOUT EXPRESS - how to get query-params?
body: <p>I call my app by <code>localhost:3000?paramname=12345</code></p>
  
  <p>inside NodeJS I have</p>
  
  <p>server.js</p>
  
  <pre><code>var http = require('http');
  var app = require('./app');
  
  var server = http.createServer(app.handleRequest).listen(3000, function ()  {
      console.log('Server running on Port 3000');
  });
  </code></pre>
  
  <p>and my app.js</p>
  
  <pre><code>var url = require('url');
  var path = require('path');
  
  function handleRequest(req, res) {
      // parse url and extract URL path
      var pathname = url.parse(req.url).pathname;  
  
      // file extention from url
      const ext = path.extname(pathname); 
  
      console.log(req.url); 
  
  });
  </code></pre>
  
  <p>now the <code>console.log(req.url)</code> would output me <code>/?paramname=12345</code></p>
  
  <p>but how would i get only the var-name <code>paramname</code> or it's value <code>12345</code> ??</p>
  
  <p>when I try everything i find, but I onl get <code>undefined</code> or the script brakes because no such function.</p>