[Vuejs]-Access-Control-Allow Origin Nuxt fetch

0👍

I managed to fix this by creating a proxy in Nuxt Axios as follows:

axios: {
  baseUrl: '/api',
  proxy: true
},
proxy: {
  "/api/": {
    target: "https://api.reddit.com/",
    pathRewrite: { "^/api/": "" }
  }
},

To this day, I’m unsure what on earth was happening. But the proxy seems to make Safari and FireFox happy.

Leave a comment