title: ajax GET call with node.js / express server
body: <p>I´m trying to write a small ajax live search for node.js. First of all here is my Clientside code: </p>
  
  <pre><code>  $('#words').bind('keyup', function(){
      getMatchingWords($('#words').val(), function (data){
        console.log('recieved data');
        console.log(data);
        $('#ajaxresults').show();
      });
    });
  
  function getMatchingWords(value, callback) {
      $.ajax('http://127.0.0.1:3000/matchword/' + value + '/', {
          type: 'GET',
          dataType: 'json',
          success: function(data) { if ( callback ) callback(data); },
          error  : function()     { if ( callback ) callback(null); }
      });
  }
  </code></pre>
  
  <p>and here ist my serverside route:</p>
  
  <pre><code>app.get('/matchword/:value', function(req, res) {
        console.log(req.params.value);
        res.writeHead(200, {'content-type': 'text/json' });
        res.write( JSON.stringify({ test : 'test'}) );
        res.end('\n');
  });
  </code></pre>
  
  <p>it works but i don´t recieve any data. data in the callback function is always null. so what i am doing wrong? thx for the help</p>