title: Node.JS with forever on Heroku
body: <p>So, I need to run my node.js app on heroku, it works very well, but when my app crashes, i need something to restart it, so i added forever to package.json, and created a file named forever.js with this:</p>
  
  <pre><code>var forever = require('forever');
  
  var child = new (forever.Monitor)('web.js', {
    max: 3,
    silent: false,
    options: []
  });
  
  //child.on('exit', this.callback);
  child.start();
  
  forever.startServer(child);
  </code></pre>
  
  <p>on my Procfile (that heroku uses to know what to start) i put:</p>
  
  <pre><code>web: node forever.js
  </code></pre>
  
  <p>alright! Now everytime my app crashes it auto restarts, but, from time to time (almost every 1 hour), heroku starts throwing H99 - Platform error, and about this error, they say:</p>
  
  <blockquote>
    <p>Unlike all of the other errors which will require action from you to correct, this one does not require action from you. Try again in a minute, or check the status site.</p>
  </blockquote>
  
  <p>But I just manually restart my app and the error goes away, if I don't do that, it may take hours to go away by itself.</p>
  
  <p>Can anyone help me here? Maybe this is a forever problem? A heroku issue?</p>