[Vuejs]-Vue ProxyTable does not work in axios

1👍

may be you will get a first hint with the debug option enabled:

logLevel: 'debug'

If you npm run dev in your terminal, you should see a note, that the proxy table is used, while starting the server.

[HPM] Subscribed to http-proxy events:  [ 'error', 'close' ]

Later, running your app, you should see the called proxy route, e.g.

[HPM] GET /static/api/returnReasons/returnReasons.php -> http://vuetools:8888

I also run in some problem with using proxy, but this was not due to axios:
webpack proxyTable is not working

Cheers,
Michael

0👍

Solved by replacing localhost with 127.0.0.1 !

-1👍

This is a problem CORS. You need a crossdomain request.
Configure your web server:

Access-Control-Allow-Origin *

Also you can customize the headers directly into the axios, passing them through the parameters:

headers: {'Access-Control-Allow-Origin': '*'},

I had a similar problem, but I don’t get result, although the documentation of the axiosis says that this is the right solution.

Leave a comment