当我使用代理时收到警告并且无法打开我的反应项目?
//包.json //这是我用户代理的package.json文件 这是 api 调用的好方法吗?
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"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:8800/api/"
}
//终端 //这里是我的终端并收到警告
PS F:\MERN\netflix-clone\netflix> npm start
> [email protected] start
> react-scripts start
When "proxy" is specified in package.json it must start with either http:// or https://
PS F:\MERN\netflix-clone\netflix>
//任何人都可以添加有关代理的简短文档`
在此输入代码
`
//pakage.json
//This is package.json file where i user proxy
is this a good way for the api calls?
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"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:8800/api/"
}
//terminal
//Here my terminal and getting warning
PS F:\MERN\netflix-clone\netflix> npm start
> [email protected] start
> react-scripts start
When "proxy" is specified in package.json it must start with either http:// or https://
PS F:\MERN\netflix-clone\netflix>
//can anyone add a short documentation on proxy`
enter code here
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的问题可能是代理末尾的
/api/
。尝试删除
/api/
:“代理”:“http://localhost:8800”
I think that your problem might be the
/api/
at the end of the proxy.Try removing the
/api/
:"proxy": "http://localhost:8800"