vite.config.ts proxy能知道代理后的真实地址嘛 #12409
Unanswered
horizon188
asked this question in
Q&A
Replies: 3 comments 1 reply
-
|
有解决方案了吗 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Didn’t you configure the proxy yourself? If you just want to get the address behind the proxy, you can try to print it through the '/api': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
rewrite: (path) => {
const result = path.replace(/^\/api/, '')
console.log(result)
return result
},
}, |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
不太理解,你是说base url吗?可以使用 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
想知道代理后的真实地址,用于调试代理配置
Reproduction
1
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions