1 Answer

0 votes
by

Let’s say we have a Node.js backend server running on localhost:4040. To ensure it is proxyed in and accessible from the components, we can configure the vue.config.js file and include a devServer section as shown below: 

In the vue.config.js file: 

module.exports: {

devServer: {
proxy: {
‘/api’: { 
target: ‘http://localhost:4040/api’, 
changeOrigin: true 
}
}
}

}

Related questions

0 votes
asked Jan 9, 2020 in VueJS by GeorgeBell
+1 vote
asked Sep 4, 2022 in AWS by Robindeniel
...