title: RESTful Get Request with Angular & NodeJS Express
body: <p>I'm just following tutorials and figuring out how to handle get requests in NodeJS.</p>
  
  <p>Here are snippets of my code:</p>
  
  <p>NodeJS:</p>
  
  <pre><code>router.get('/test', function(request, response, next) {
      console.log("Received Get Request");
      response.jsonp({
          data: 'test'
      });
  });
  </code></pre>
  
  <p>Angular:</p>
  
  <pre><code>$http.get("http://localhost:3000/test").
  success(function(response) {
      alert("OK");
  }).
  error(function(response) {
      alert("FAIL");
  });
  </code></pre>
  
  <p>If I try to access the link directly @ <code>localhost:3000/test</code>, I'm able to receive the JSON message correctly. But when I use angularJS $http call, the request always fails and I'll find this error in the network inspector (Response)</p>
  
  <blockquote>
    <p>SyntaxError:JSON.parse:unexpected end of data at line 1 column 1 of
    the JSON data</p>
  </blockquote>
  
  <p>The reason for that is because the response is empty but the response code is 200 in both cases.</p>
  
  <p>I've tried searching for hours but maybe someone can enlighten me on this?</p>