title: Configure default document for node on Azure app service
body: <p>We have an Azure App Service where we deploy a simple web app, a SPA based on React. We have selected the Node.js stack (currently version 10.1) in the Azure Portal for the App Service configuration but at the moment we are only interested in serving the index.html page that drives the rest of the app. There are no serverside js code running.</p>
  
  <p>How can I configure the Node.js stack to "redirect" an incoming request for the root (i.e. <a href="https://thesite.azurewebsites.net" rel="nofollow noreferrer">https://thesite.azurewebsites.net</a>) to actually serve the index.html content. Right now, when I request the root I'll get a 'Cannot GET /' response back which I suspect is from the generic Node.js hosting (iisnode perhaps?)</p>
  
  <p>Requesting the root works great on my local dev machine when running <code>npm start</code> so I think it is a matter of getting the node.js stack configured wehn hosted on Azure.</p>
  
  <p>I have tried to deploy a simple web.config in the hopes that it'll get picked up and perform a rewrite but it does not affect the root request.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
  &lt;system.webServer&gt;
      &lt;rewrite&gt;
          &lt;rules&gt;
              &lt;rule name="DynamicContent"&gt;
                  &lt;match url="/*" /&gt;
                  &lt;action type="Rewrite" url="index.html"/&gt;
              &lt;/rule&gt;
          &lt;/rules&gt;
      &lt;/rewrite&gt;
  &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Can anybody help me figure out what needs to be done to succeed with this?</p>