We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我わが想そう在ざい访问 http://localhost/api/client/xxx 的てき时候,代理だいり到いた http://10.1.44.95:8080/sz/api/,所以ゆえん我わが写うつし了りょう如下配置はいち:
http://localhost/api/client/xxx
http://10.1.44.95:8080/sz/api/
/* eslint-disable */ const delay = require('mocker-api/utils/delay'); const proxy = { _proxy: { proxy: { '/api/client/(.*)': 'http://10.1.44.95:8080/sz/api/' }, changeHost: true, }, }; module.exports=delay(proxy, 0);
但ただし是ぜ在ざい请求的てき时候还是会かい把わ/api/client带过去さ
/api/client
$ curl http://localhost:3721/api/client/12 {"timestamp":1576654898376,"status":404,"error":"Not Found","message":"Not Found","path":"/sz/api/api/client/12"}
我わが想そう要よう的てき效果こうか是ぜ访问 http://localhost:3721/api/client/12, 就代理だいり到いた /sz/api/12
http://localhost:3721/api/client/12
/sz/api/12
看み到いた webpack 里さと面めん可か以用 pathRewrite,单独使用しよう没ぼつ有ゆう找到设置方法ほうほう
试了好こう多た配置はいち,貌似没ぼつ有效ゆうこう果はて啊。。
The text was updated successfully, but these errors were encountered:
feat: Add pathRewrite options. #62
db5a774
released v1.10.0 #62
b244a4d
@zhang0ZGC + mocker-api@1.10.0 现在支持しじ类似 webpack 类似的てき参まいり数すう设置 pathRewrite
+ mocker-api@1.10.0
webpack
pathRewrite
{ proxy: { '/api/repos/(.*)': 'http://127.0.0.1:3721/' }, pathRewrite: { '^/api/repos/': '/repos/', }, }
Sorry, something went wrong.
万まん分ふん感かん谢 😄
No branches or pull requests
http://localhost/api/client/xxx
http://10.1.44.95:8080/sz/api/
,/api/client
带过http://localhost:3721/api/client/12
, 就/sz/api/12
试了好 多 配置 ,貌似没 有效 果 啊。。
The text was updated successfully, but these errors were encountered: