title: Range Error: invalid status code: 0
body: <p>i am new in nodejs, i have used visual studio 2015 web express for learn about node js development. 
  Every thing works fine &amp; run simple app.get method smoothly and now i want to retrieve some list from nodejs, but it not works.</p>
  
  <p>I have read an article and try to implement. <a href="http://www.dotnetcurry.com/nodejs/1032/nodejs-apps-in-visual-studio-mean-stack" rel="nofollow noreferrer">Check here</a>        </p>
  
  <p>I have following code:</p>
  
  <pre><code>var http = require('http');
  var express = require('express');
  
  var bodyParser = require('body-parser');
  
  var port = process.env.port || 1337;
  
  var app = express();
   app.use(bodyParser.urlencoded({ 
  extended: true
  }));
  
  
  app.get('/api/list', function (request, response) {
  response.status(200).json(
      { "movieId": 1, "name": "The Pacific Rim" },
      { "movieId": 2, "name": "Transformer" });
  });
  
  app.listen(port);
  </code></pre>
  
  <p>I am getting following error in browser when I visit "<a href="http://localhost:1337/api/list" rel="nofollow noreferrer">http://localhost:1337/api/list</a>"</p>
  
  <pre><code>RangeError: Invalid status code: 0
  at ServerResponse.writeHead (_http_server.js:192:11)
  at ServerResponse._implicitHeader (_http_server.js:157:8)
  at ServerResponse.OutgoingMessage.end (_http_outgoing.js:574:10)
  at ServerResponse.send (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\response.js:211:10)
  at ServerResponse.json (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\response.js:256:15)
  at ServerResponse.send (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\response.js:158:21)
  at c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\server.js:22:14
  at Layer.handle [as handle_request] (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\router\layer.js:95:5)
  at next (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\router\route.js:137:13)
  at Route.dispatch (c:\users\XYZ12\documents\visual studio 2015\Projects\NodeMovieList\NodeMovieList\node_modules\express\lib\router\route.js:112:3)
  </code></pre>