title: How to deploy a reveal.js app to heroku?
body: <p>I am trying to deploy a reveal.js application to Heroku. Reveal.js runs on node via <code>grunt connect</code> command. The app also requires ruby for compiling assets on-the-fly. Locally, I can run the app by using <code>grunt serve</code>. </p>
  
  <p>Initially, because of compass being a dependency of <code>grunt watch</code>, Heroku only detected the Gemfile and assumed I was running a ruby app. I used the nodejs custom buildpack to force Heroku to see it as a nodejs app. </p>
  
  <p>Procfile contains</p>
  
  <pre><code>web: grunt serve
  </code></pre>
  
  <p>Log shows</p>
  
  <pre><code> 2013-06-17T13:51:56.187012+00:00 heroku[router]: at=error code=H14 desc="No web processes running"
  </code></pre>
  
  <p><code>heroku ps</code> shows nothing either. I can run "heroku run grunt serve" successfully, and I have modified the default Gruntfile.js that comes with reveal to accept process.env i.e.</p>
  
  <pre><code>connect: {
    server: {
      options: {
        port: process.env.PORT || 8000,
        base: '.'
      } 
    }
  }
  </code></pre>
  
  <p>As a last attempt, I tried using the Heroku-nodejs-grunt build pack (<a href="https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt" rel="nofollow">https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt</a>) which will run a grunt task on deploy to compile assets. Still no luck, <code>heroku logs --tail</code> still shows no process running. Exploring with <code>heroku run</code> reveals that grunt is available, and the <code>grunt serve</code> command successfully executes. </p>
  
  <p>When starting to use the new grunt build pack I got an error with the above Gruntfile.js saying "process" is undefined. I switched the port to 0.</p>
  
  <blockquote>
    <p>The port on which the webserver will respond. The task will fail if
    the specified port is already in use. You can use the special values 0
    or '?' to use a system-assigned port.</p>
  </blockquote>
  
  <p>Didn't work, tried "?", didn't work (still no web process and <code>heroku restart</code> doesn't do anything)</p>
  
  <p>I can't figure out how to get Heroku to use grunt serve as my main web server process!</p>