我为我的 React 应用程序使用了两台服务器,一台用于 express,另一台用于 create-react-app。所以在 package.json 的反应端服务器中,我添加了:
"proxy": {
"/auth/google": {
"target": "http://localhost:5000"
}
},
Run Code Online (Sandbox Code Playgroud)
我运行服务器,但出现此错误:
When specified, "proxy" in package.json must be a string.
Instead, the type of "proxy" was "object".
Either remove "proxy" from package.json, or make it a string.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?如何添加代理?也许使用其他语法?