Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request forwarding to mock #177

Merged
merged 1 commit into from
Mar 20, 2017
Merged

Conversation

yesmeck
Copy link
Contributor

@yesmeck yesmeck commented Mar 17, 2017

支持下面两种情况:

// Forward 到另一个服务器,不指定来源服务器
'GET /assets/*': 'https://assets.online/',

// Forward 到另一个服务器,并指定子路径
// 请求 /someDir/0.0.50/index.css 会被代理到 https://g.alicdn.com/tb-page/taobao-home, 实际返回 https://g.alicdn.com/tb-page/taobao-home/0.0.50/index.css
'GET /someDir/(.*)': 'https://g.alicdn.com/tb-page/taobao-home',

close #174

@yesmeck
Copy link
Contributor Author

yesmeck commented Mar 17, 2017

突然发现直接在 .roadhogrc 里配置 proxy 就可以了,那这个功能是重复的了。

@yesmeck yesmeck closed this Mar 17, 2017
@yesmeck yesmeck reopened this Mar 17, 2017
@yesmeck
Copy link
Contributor Author

yesmeck commented Mar 17, 2017

@sorrycc 觉得有必要加吗?

@sorrycc sorrycc merged commit a8897d9 into sorrycc:master Mar 20, 2017
@zjjjjjjjjjjd
Copy link

@yesmeck 所以现在是有实现的吗?还是习惯于dora的proxy模式,方便联调的时候改。刚刚入坑roadhog,目前版本似乎还是不支持直接在.roadhogrc.mock.js内设置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mock 支持 request forwarding
3 participants