title: Running NodeJs http-server forever with PM2
body: <p>My question is about running HTTP-server in combination with PM2.</p>
  <p>The problem I face is that:</p>
  <ol>
  <li>HTTP-server requires as input a folder which is the root of the website and a port number to run the website on.</li>
  <li>PM2 doesn't recognize the HTTP-server command, even when HTTP-server is installed with the <code>-g</code> option.</li>
  </ol>
  <p>So I tried the following (note the double dash which should pass the parameters to the HTTP-server script:</p>
  <pre><code>/node_modules/http-server/lib$ pm2 start http-server.js -- /home/unixuser/websiteroot -p8686
  </code></pre>
  <p>But it doesn't work.</p>
  <p>I also tried:</p>
  <pre><code>http-server /home/unixuser/websiteroot -p8686
  </code></pre>
  <p>Which does work, but doesn't have the great support of pm2 ?</p>
  <p>Any suggestions would be great, thanks!</p>