I have deployed my react app in Vultr
server and installed nginx
in server and configured the below settings by running below command.
$ sudo nano /etc/nginx/sites-available/default
server {
listen 80;
server_name somedomain-test.com www.somedomain-test.com;
root /var/www/somedomain-test.com/build;
index index.html;
}
I did ran npm run build
and copied the build folder into the following destination folder /var/www/automateandmore.com/build
Then ran below commands:
$ sudo nginx -t
$ sudo systemctl restart nginx
I able to see the front end. Now I have started the server.js
from the folder location src/
but still I can see it is calling localhost:8000/service/listofblogs:
How do i fix the issue, could someone please advise ?
This is my package.json settings
{
"name": "myblogs",
"version": "0.1.0",
"private": true,
"dependencies": {
.....
},
"proxy": "http://localhost:8000",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
....
}
}
.env file
DANGEROUSLY_DISABLE_HOST_CHECK=true
REACT_APP_URL=http://somedomain-test.com