Sign in
Log inSign up

proxy configuration in the vue.config.js file

Raffaele Iavazzo's photo
Raffaele Iavazzo
·Sep 19, 2020·

1 min read

who could explain me all lines of this code, step by step?

vue.config.js:

module.exports = {
//configure webpack-dev-server behavior
  devServer: {
    proxy: {
      '/api': {
        target: 'localhost:3000/',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  }
}

thanks in advance, you would do me a great pleasure.