proxyTable with Axios
See original GitHub issueHi to all,
i’m trying to configure proxyTable, and i have just copied the example in documentation:
proxyTable: {
// proxy all requests starting with /api to jsonplaceholder
'/api': {
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
After that, i have run npm run dev
(i have added this on config/index.js
).
When i try to use axios, the requests are sent to http://localhost:8080
and not to http://jsonplaceholder.typicode.com
.
the request sent with axios is quite simple:
axios.get('/api/1') // Just for example
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Vue ProxyTable does not work in axios - Stack Overflow
But it don't work in axios,the error says GET http://localhost:8085/api/user/login?username=xx&password=123 504 (Gateway Timeout) .
Read more >API Proxying and axios - Get Help - Vue Forum
Hi to all, i'm trying to configure proxyTable, and i have just copied the example in documentation: proxyTable: { // proxy all requests...
Read more >API Proxying During Development · GitBook
proxyTable option in config/index.js . The dev server is using http-proxy-middleware for proxying, so you should refer to its docs for detailed usage....
Read more >vue axios 设置proxyTable跨域后访问接口404 - CSDN博客
描述我是用的是本地IP启动我的项目我想访问的接口是http://192.168.100.217:2000/api/OrganizationManager/Get_Load这是我proxy的配置代码proxyTable: ...
Read more >通过axios自带的proxytable配置跨域为什么没有效果呢?
axios 有一个自带的proxytable属性看文档是用来设置请求代理的但是设置之后并没有效果呢? 另外react项目一般是怎样请求代理的呢? 3 回复. waitingsong 1楼•3 年前.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would also like to know this, because I moved from vue-resources to axios and proxyTable in webpack is not working anymore. Any suggestions?
Well, the request will of course be sent to localhost:8080, which will then send the request to http://jsonplaceholder.typicode.com - that’s what proxys do.