I am trying to publish a React application to a web app service but I am only seeing this page when I navigate to my url.
I am using FTP to load the output of my create-react-app build directory to the wwwroot folder in the app service. I can verify these have been moved over correctly via shelling into the app service.
After I publish the files via FTP, I would restart the app service, but I only continue to see the default app service page instead of my index.html. I am not sure where to really go from here, but I feel like the app service server is still caching the old initial default page?
Your problem comes because the linux azure app service is different from windows azure app service. Linux app service don't have default documents so you need to set. So follow the steps below:
1.add a file name index.js
under the site/wwwroot
.
index.js:
var express = require('express');
var server = express();
var options = {
index: 'index.html'
};
server.use('/', express.static('/home/site/wwwroot', options));
server.listen(process.env.PORT);
2.install express:
run this command under the wwwroot directory,
npm install -save express
3.restart your app service and wait for minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With