我正在DigitalOcean上运行我的MERN应用程序,并且似乎收到代理错误,以响应来自对本地主机上的Express服务器的请求。但是这个问题在Heroku上并没有持续存在。 (代理错误:无法将请求/ api / stores从http://localhost:3000代理到http://localhost:5000)。我应该怎么做才能解决这个问题?
我的客户端程序包json是:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"cryptr": "^4.0.2",
"jquery": "^3.4.1",
"jquery.soap": "^1.7.3",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1",
"xhr2": "^0.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:5000"
}