none
create-react-app/fullstack showing 'Hey, Node developers!' RRS feed

  • Question

  • I have followed a couple of threads about deploying a cra app. None have worked. Any change I've made displays the 'Hey, Node developers!' page.

    I ran 'npm run build' and ftp-ed the static folder to /site/wwwroot/. I also tried the following file, web.config, in the wwwroot folder. 

    <?xml version="1.0"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="React Routes" stopProcessing="true">
              <match url=".*" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
              </conditions>
              <action type="Rewrite" url="/" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>

    If I try my URL appending a valid route, https://mywebsite.azurewebsites.net/someRoute, I get a 404.

    The structure of the project is

    build/
    package.json
    public/
    server/
    sql/
    src/

    I started the project with create-react-app and added an a Node Express server at the `server` directory. The server is proxied via the `proxy` key in `package.json`

    Both the src and server folders contain index.js files. Each index.js file starts on its own unique port. The server makes SQL calls to an MSSQL database. I have managed to sync the in-house db to the Azure DB.

    Any ideas on what I might try?

    Thursday, December 26, 2019 6:34 PM

Answers