2

I have configured devserver in vue-config.js before like this:

devServer: {
  proxy: {
    "/api/*": {
      target: "http://localhost:3001",
      secure: false
    }
  }
}

In nuxt-SPA this dont work. My front is still sending API-calls to same origin localhost:3000. How to configure API-calls to different port?

Mikko
  • 55
  • 1
  • 6

1 Answers1

2

Duplicate of How to use webpack dev proxy with Nuxt https://github.com/nuxt/nuxt.js/issues/762

Due to its unversal app nature Nuxts doe not have webpack proxy.

Simpliest one to implement is here - https://github.com/nuxt-community/proxy-module

Ivan Klochkov
  • 705
  • 4
  • 14