I\'ve developed an PoC about PWA (Progressive Web Apps) using ReactJs to show how to use camera, geolocation, microphone, light sensors and etc from Browser API.
I\'
After a little more research I found the problem. As Linux Azure Web Apps uses pm2 to serve a node app I found the answer looking into the official documentation.
PM2 is a daemon process manager that will help you manage and keep your application online. Getting started with PM2 is straightforward, it is offered as a simple and intuitive CLI, installable via NPM.
https://pm2.keymetrics.io/docs/usage/pm2-doc-single-page/#serving-spa-redirect-all-to-indexhtml
Just need to add the --spa
option into the Startup Command on Azure Web Apps Linux General Settings:
pm2 serve /home/site/wwwroot/build --no-daemon --spa
Using --spa
option pm2 will automatically redirect all queries to the index.html and then react router will do its magic.