title: Heroku is giving me a 503 when trying to open my web app, works on local host
body: <p>I am trying to deploy to heroku but get a 503 even though it runs on localhost. I am curious as to if my server is set up correctly as I am newer to programming. I hope anyone can point me in the correct direction as to where to look or provide a suggestion as I have spent countless hours on google to this point spanning a couple of weeks.</p>
  
  <p>My main question is if I have set up my server correctly? I am not sure my listener will work for heroku and my .get are used for debugging on localhost when it was initially set up. </p>
  
  <p>Also my full project is available here:</p>
  
  <p><a href="https://github.com/dirkdir/DerekDevSite" rel="noreferrer">https://github.com/dirkdir/DerekDevSite</a> </p>
  
  <pre><code>var express = require('express');
  var app = express();
  var path = require('path');
  
  
  app.use(express.static(path.join(__dirname, 'public')));
  
  
  app.get('/json', function(req, res) {
      console.log("GET the json");
      res
          .status(200)
          .json( {"jsonData" : true} );
  });
  
  app.get('/file', function(req, res) {
      console.log("GET the file");
      res
          .status(200)
          .sendFile(path.join(__dirname, 'app.js'));
  });
  
  
  
      var server = app.listen(process.env.PORT || 5000), function() {
          var port = server.address().port;
          console.log("Express is working on port " + port);
  });
  </code></pre>
  
  <p>Logs:</p>
  
  <p>2017-04-24T20:04:43.755866+00:00 app[web.1]:     at Module._compile (module.js:542:28)
  2017-04-24T20:04:43.755867+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:579:10)
  2017-04-24T20:04:43.755868+00:00 app[web.1]:     at Module.load (module.js:487:32)
  2017-04-24T20:04:43.755868+00:00 app[web.1]:     at tryModuleLoad (module.js:446:12)
  2017-04-24T20:04:43.755869+00:00 app[web.1]:     at Function.Module._load (module.js:438:3)
  2017-04-24T20:04:43.755869+00:00 app[web.1]:     at Module.runMain (module.js:604:10)
  2017-04-24T20:04:43.755870+00:00 app[web.1]:     at run (bootstrap_node.js:393:7)
  2017-04-24T20:04:43.755871+00:00 app[web.1]:     at startup (bootstrap_node.js:150:9)
  2017-04-24T20:04:43.846556+00:00 heroku[web.1]: State changed from starting to crashed
  2017-04-24T20:26:31.826133+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=derekdyerdev.herokuapp.com request_id=609ef253-0a56-41ac-b877-1fb242f6f4e1 fwd="69.36.89.218" dyno= connect= service= status=503 bytes= protocol=https
  2017-04-24T20:26:32.319732+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=derekdyerdev.herokuapp.com request_id=f2a34e62-9765-</p>