Vue proxy setting does not work Vue proxy setting does not work vue.js vue.js

Vue proxy setting does not work


The article likely refers to an outdated method of setting up the proxy. The latest version of @vue/cli (currently 3.0.0-rc.3) has a new method of configuring the dev server.

For an equivalent setup of that proxy, create vue.config.js (if it doesn't exist already) with the following contents:

module.exports = {  devServer: {    proxy: {      '/api': {        target: 'http://localhost:9000',        ws: true,        changeOrigin: true      }    }  }}