How to share cross-origin resource?
The solution of cross origin resource sharing in Nuxt.js
npm i @nuxtjs/proxy
In nuxt.config.js
modules: [
'@nuxtjs/axios',
'@nuxtjs/proxy'
],
proxy: {
'/api': {
target: 'http://example.com',
pathRewrite: {
'^/api' : '/'
}
}
}