title: Deploy Node.js RestFull API to Heroku
body: <p>I have a school assignment where i must build a node.js server (<strong>Without Express</strong>) that receives a POST request containing <strong>{day: 25, month:12, year:2017}</strong> and sends the number of days remaining to that date.</p>
  
  <p>I was able to solve this using <strong>moment</strong> npm package (<a href="https://www.npmjs.com/package/moment" rel="nofollow noreferrer">https://www.npmjs.com/package/moment</a>)</p>
  
  <p>The server is listening on port 3000.</p>
  
  <p>The code works perfectly when i send a post request to 127.0.0.1:3000</p>
  
  <p>However, i changed listen port to 80, created a new app on heroku and then deployed my code and it doesn't work anymore, heroku says application crash.</p>
  
  <p>Does anyone have an idea ?</p>
  
  <p>server is created like this : </p>
  
  <pre><code>var http = require('http');
  var moment = require('moment');
  moment().format();
  
  var server = http.createServer(function(request, response) {
      ....
  });
  server.listen(80);
  </code></pre>