1

My Web App Service running on Linux serves a React App which is has its build files in wwwroot, served using a pm2 process that runs npx serve:

ecosystem.config.js

module.exports = {
  apps: [
    {
      script: "npx serve -s",
    },
  ],
};

This worked fine until serve randomly started serving the entire /home directory instead of the index.html file in the wwwroot. This is what the web page in the browser looks like now.

enter image description here

The pm2 process seems to be running fine.

enter image description here

Any ideas?

Qurillion
  • 33
  • 6

1 Answers1

2

We had a bunch of sites go down today or this weekend with same issue. I have a ticket in with M$ to understand why, but we were able to temporarily fix by using the startup command option in azure.

App Service Configuration

Todd B
  • 46
  • 1
  • I have the same issue with a React app on App Service that's happened in the past few days. The suggested workaround in your answer worked for me. Thanks. If you get a response from MS please post an update. – Aleks Sep 16 '20 at 05:24
  • I used a similar workaround, but my startup command switches to pm2, the --spa option is for client side routing `pm2 serve /home/site/wwwroot --no-daemon --spa` – Qurillion Sep 16 '20 at 09:43