[Vuejs]-CORS with axios

0👍

The ‘Access-Control-Allow-Origin’ is type of response header and this must be set by the server.

So you need to change the server’s CORS policy to allow your origin: http://localhost:63342 .

0👍

You can use Proxy server to avoid CORS Error.
Write this codes at vue.config.js.

module.exports = {
    devServer: {
        proxy: {
            '/': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                pathRewrite: {
                    '^/': ''
                }
            }
        }
    }
}

Leave a comment