create-react-app 构建的项目使用代理 proxy
发布时间:2020-12-15 20:39:01 所属栏目:百科 来源:网络整理
导读:正常运行 npm run eject create-react-app 的版本在低于 2.0 的时候可以在 package.json 增加 proxy 配置, 配置成如下: "proxy":{ "/fans/**":{ "target":"https://easy-mock.com/mock/5c0f31837214cf627b8d43f0/","changeOrigin": true } } create-react-
"proxy":{ "/fans/**":{ "target":"https://easy-mock.com/mock/5c0f31837214cf627b8d43f0/","changeOrigin": true } }
"proxy": "https://easy-mock.com/mock/5c0f31837214cf627b8d43f0/",
const proxy = require("http-proxy-middleware"); module.exports = function(app) { app.use( proxy("/fans/**",{ target: "https://easy-mock.com/mock/5c0f31837214cf627b8d43f0/",changeOrigin: true }) ); }; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- FluorineFx + Flex视频聊天室案例开发----客户端
- 使用 Dojo 显示表格数据,并带筛选(filter)功能
- 使用冲突的元素名称解压缩Go中的XML
- c# – 停靠多行文本框由StatusStrip覆盖
- ruby-on-rails – 从raspberry pi远程连接到rails服务器
- xml配置文件不能被正确解析的特殊符号的处理方法
- 在XSLT中添加缺少的XML元素需要什么?
- swift - The Builder Pattern
- adb opendir failed ,permission denied 暨cmd下查看真机中
- ruby-on-rails – 更好地支持Netbeans中的HAML?