Error while serving /home/ubuntu/my-app/source/build/login with content-type text/plain : ENOENT: no such file or directory, open '/home/ubuntu/my-app/source/build/login'
I have just cloned this repo and installed the app in my Amazon EC2 instance. Here goes my PM2 configuration file.
Error while serving /home/ubuntu/my-app/source/build/login with content-type text/plain : ENOENT: no such file or directory, open '/home/ubuntu/my-app/source/build/login'
I have just cloned this repo and installed the app in my Amazon EC2 instance. Here goes my PM2 configuration file.
And here goes my Package.json file script.
"scripts": { "build": "react-scripts build" }
And once my build is compiled successfully, I am serving the static build folder using
pm2 serve build 3000
The site loads successfully. But when I hit the Url like https://my-app.com/login directly in the browser, I get the error 404 Not Found.
But I see no error while navigating. This issue occurs only when hitting any component URL directly or while refreshing from other than a home page.
What am I missing? Thank you.