title: Can't get express.js working with IISNode
body: <p>I've set IISNode up on a server, and followed a guide to get a simple hello world node.js app running with it. It works fine and it's externally accessible via the internet. However, when I try to incorporate my existing express app, it's like node/express aren't even there.</p>
  
  <p>This is my web.config file:</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;system.webServer&gt;
  
  &lt;handlers&gt;
  &lt;add name="iisnode" path="app.js" verb="*" modules="iisnode" /&gt;
  &lt;/handlers&gt;
  
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>That is at the IIS application's root directory, along with app.js which is my main express file. What's interesting is if I go to localhost/TestApp/app.js, I get back:</p>
  
  <pre><code>Cannot GET /TestApp/app.js
  </code></pre>
  
  <p>However, if I try a different file, like localhost/TestApp/public/htm/index.htm, I get back the file that is located there (in HTML, as expected). Also, if I try and do a server call (e.g. localhost/TestApp/GetUsernames).</p>
  
  <p>What's even more interesting is that if I mess up the port (e.g. app.listen(process.env.PORT2 );), I get this when I try and access localhost/TestApp.js:</p>
  
  <blockquote>
  <pre><code>&gt; iisnode encountered an error when processing the request.
  &gt; 
  &gt; HRESULT: 0x2 HTTP status: 500 HTTP reason: Internal Server Error
  </code></pre>
  </blockquote>
  
  <p>If the port is correct (app.listen(process.env.PORT2);), I get Cannot GET /TestApp/app.js, so it does look like IISNode is executing app.js (how else would it be failing when I mess up the port), but nothing seems to be working.</p>
  
  <p>How might I fix this, or at least diagnose the problems?</p>
  
  <p>Thank you.</p>