0

I have a node app that has both a react native front end and a node API

I want to be able to just run npm install for both folders and then just have it run the start command "node server" (node/server/index.js) to have the node app running.

But I can't seem to figure out the release tasks to make this happen.

I am using the preview continous delivery that connects to visual studio online

HexBlit
  • 1,172
  • 1
  • 13
  • 31

1 Answers1

0

In my opinion, it has nothing to do with continuous delivery. Since Azure App Service runs on Microsoft IIS, you'll need to have an IIS configuration file named web.config and should include the following section to match your requirement:

<handlers>
  <add name="iisnode" path="./node/server/index.js" verb="*" modules="iisnode"/>
</handlers>

This indicates that the node/server/index.js file is a node.js site to be handled by the iisnode module.

<rewrite>
  <rules>
    <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
    <rule name="StaticContent">
      <action type="Rewrite" url="public{REQUEST_URI}"/>
    </rule>

    <!-- All other URLs are mapped to the node.js site entry point -->
    <rule name="DynamicContent">
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
      </conditions>
      <action type="Rewrite" url="./node/server/index.js"/>
    </rule>
  </rules>
</rewrite>

These rewrite rules determine where your static content and dynamic content should be located in.

For a completed web.config file you can check this post out.

Aaron Chen
  • 9,835
  • 1
  • 16
  • 28