title: Deploy node.js app on heroku succeeds but doesn't work
body: <p>I have a very simple, straight-forward node.js app [1] I want to deploy on heroku. Although I'm able to deploy it, the page can't be accessed in the browser.</p>
  
  <p>I followed the advices from the 'Getting Started with Node.js on Heroku' guide [2]. When I run the application using <code>node index.js</code> locally, I'm able to access the application at <code>http://localhost:8080/index.jade</code>, however, when I try to access it on heroku at <code>http://immonow.herokuapp.com:8080/index.jade</code> it would throw me a <code>ERR_CONNECTION_REFUSED</code> HTTP error code.</p>
  
  <p>How I deployed my app:</p>
  
  <ol>
  <li><code>git commit -am "made changes"</code> // commit changes</li>
  <li><code>git push origin master</code> // push to git</li>
  <li><code>heroku create</code> // create heroku app</li>
  <li><code>git push heroku master</code> // push to heroku</li>
  <li><code>heroku ps:scale web=1</code> // start workers</li>
  </ol>
  
  <p>My node.js server:</p>
  
  <pre><code>#!/usr/bin/env node
  var http = require('http')
    , jade = require('jade')
    , static = require('node-static')
    , jadeRe = /\.jade$/
    , path = process.argv.slice(2)[0]
    , fileServer = new static.Server(path || '.')
  
  http.createServer(function (req, res) {
    if (req.url.match(jadeRe)) {
      res.writeHead(200, {'Content-Type': 'text/html'})
      res.end(jade.renderFile('.' + req.url, {
        filename: '.' + req.url.replace(jadeRe, '')
      }))
    } else {
      req.addListener('end', function () {
        fileServer.serve(req, res)
      }).resume()
    }
  }).listen(8080)
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>[1] <a href="https://github.com/takahser/immonow" rel="noreferrer">https://github.com/takahser/immonow</a></p>
  
  <p>[2] <a href="https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction" rel="noreferrer">https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction</a></p>