title: Node.js azure web app can't access my routes
body: <p>I have the following <code>index.js</code> file:</p>
  
  <pre><code>const express = require('express');
  const app = express();
  const router = express.Router();
  var cors = require('cors');
  var http = require('http').Server(app);
  const fileUpload = require('express-fileupload');
  app.use(fileUpload());
  const uploadRoute = require('./routes/upload');
  
  app.use(cors());
  
  app.use(uploadRoute(router));
  app.use(router);
  http.listen(80, function () {
      console.log('listening on *:80');
  });
  </code></pre>
  
  <p>And the following web.config file:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!--
       This configuration file is required if iisnode is used to run node processes behind
       IIS or IIS Express.  For more information, visit:
  
       https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
  --&gt;
  
  &lt;configuration&gt;
    &lt;system.webServer&gt;
      &lt;!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support --&gt;
      &lt;webSocket enabled="false" /&gt;
      &lt;handlers&gt;
        &lt;!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module --&gt;
        &lt;add name="iisnode" path="index.js" verb="*" modules="iisnode"/&gt;
      &lt;/handlers&gt;
      &lt;rewrite&gt;
        &lt;rules&gt;
          &lt;!-- Do not interfere with requests for node-inspector debugging --&gt;
          &lt;rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true"&gt;
            &lt;match url="^index.js\/debug[\/]?" /&gt;
          &lt;/rule&gt;
  
          &lt;!-- First we consider whether the incoming URL matches a physical file in the /public folder --&gt;
          &lt;rule name="StaticContent"&gt;
            &lt;action type="Rewrite" url="public{REQUEST_URI}"/&gt;
          &lt;/rule&gt;
  
          &lt;!-- All other URLs are mapped to the node.js site entry point --&gt;
          &lt;rule name="DynamicContent"&gt;
            &lt;conditions&gt;
              &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/&gt;
            &lt;/conditions&gt;
            &lt;action type="Rewrite" url="index.js"/&gt;
          &lt;/rule&gt;
        &lt;/rules&gt;
      &lt;/rewrite&gt;
  
      &lt;!-- 'bin' directory has no special meaning in node.js and apps can be placed in it --&gt;
      &lt;security&gt;
        &lt;requestFiltering&gt;
          &lt;hiddenSegments&gt;
            &lt;remove segment="bin"/&gt;
          &lt;/hiddenSegments&gt;
        &lt;/requestFiltering&gt;
      &lt;/security&gt;
  
      &lt;!-- Make sure error responses are left untouched --&gt;
      &lt;httpErrors existingResponse="PassThrough" /&gt;
  
      &lt;!--
        You can control how Node is hosted within IIS using the following options:
          * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
          * node_env: will be propagated to node as NODE_ENV environment variable
          * debuggingEnabled - controls whether the built-in debugger is enabled
  
        See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
      --&gt;
      &lt;!--&lt;iisnode watchedFiles="web.config;*.js"/&gt;--&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Now i add this to my server which makes it look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/5kmpz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5kmpz.png" alt="enter image description here"></a></p>
  
  <p>I then attempt to start the server using forever <code>forever start index.js</code>
  then i go to my website and try out a route but it just gives me an error code 500.</p>
  
  <p>Can anyone tell me what ive done wrong?</p>