title: Heroku NodeJS http to https ssl forced redirect
body: <p>I have an application up and running on Heroku with Express.js on Node.js with <code>https</code>. How do I identify the protocol to force a redirect to <code>https</code> with Node.js on Heroku?</p>
  <p>My app is just a simple <code>http</code>-server, it doesn't (yet) realize Heroku is sending it <code>https</code>-requests:</p>
  <pre class="lang-js prettyprint-override"><code>// Heroku provides the port they want you on in this environment variable (hint: it's not 80)
  app.listen(process.env.PORT || 3000);
  </code></pre>