title: Nodejs Heroku Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
body: <ul>
  <li><p>I have tried number of "Error R10" Solutions, but it doesn't solve the problem for a simple Hello World like Nodejs app with server.js, package.json, index.html and node_module </p></li>
  <li><p>Hereby adding server.js, package.json and error log</p></li>
  <li><p>Currently trying this app on free heroku acount </p></li>
  <li>Is it necessary to upload nodejs app  on github to host it on heroku</li>
  </ul>
  
  <p>server.js</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var bodyParser = require('body-parser');
  
  var port = 3000;
  
  var app = express();
  
  // Set Static Folder
  app.use(express.static(__dirname));
  // Body Parser MW
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: false}));
  
  
  var env = process.env.NODE_ENV || 'development';
  if ('development' == env) {   
      app.use(express.static(__dirname + '/'));   
  } else {
      app.use(express.static(__dirname + '/'));
  }
  
  app.get("/", function(req, res){
      res.render("index.html");
  });
  
  app.listen(port, function(){
      console.log("Server started ..!");
  });
  </code></pre>
  
  <p>package.json</p>
  
  <pre><code>{
        "name": "es1",
        "version": "1.0.0",
        "description": "eS",
        "main": "server.js",
        "scripts": {
          "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
        },
        "author": "",
        "license": "ISC",
        "dependencies": {
          "body-parser": "^1.16.0",
          "express": "^4.14.0"
        }
      }
  </code></pre>
  
  <h2>Attaching heroku logs:</h2>
  
  <p><a href="https://drive.google.com/open?id=0B4XtAe7mRM6UVllTQWh1dmplZk0" rel="nofollow noreferrer">https://drive.google.com/open?id=0B4XtAe7mRM6UVllTQWh1dmplZk0</a></p>