0👍
If your backend works on let’s say localhost:80, and your vue app works on localhost:8080, you can proxy specific requests to backend prefixing routes so that dev server understands what requests to proxy
// vue.config.js
module.exports = {
devServer: {
port: 8080,
proxy: {
"/api": {
target: "http://localhost:80"
}
}
}
}
Now requests to /api/first-vue and /api/second-vue will be proxied to 80th port
- [Vuejs]-How do I implement Electron's webview into my Vue project?
- [Vuejs]-Vue with own backend code on server (Node.js+Vue.js)
Source:stackexchange.com