pagekit / vue-resource

The HTTP client for Vue.js
MIT License
10.08k stars 1.6k forks source link

vue-resource could work with proxyTable configration? #560

Open YanwuSenlu opened 7 years ago

YanwuSenlu commented 7 years ago

I have config the proxyTable in the config/index.js created by vue-cli proxyTable: { '/api': { target: 'http://ip:8080', changeOrigin: true, pathRewrite: { '^/api': '/api', }, },`

in my components ,when i use this.$http.get('/api/myapi'),the request is still send to localhost.

lemmycaution commented 7 years ago

👍 same here, couldn't find the reason, any help much appreciated.

mario-shang commented 6 years ago

I replaced the 'localhost' in the target to IP, and all clear.