My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

proxy rule in the vue.config.js file

Raffaele Iavazzo's photo
Raffaele Iavazzo
·Sep 20, 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: 'http://localhost:3000/',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  }
}

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