设置express代理请求
在基于vue-cli的项目中,在开发环境配置(config/dev.env.js)中设置代理,能够将所有/apidomain开头的请求都通过npm run dev启动的express服务器重定向到目标接口
官方文档:https://vuejs-templates.github.io/webpack/proxy.html
proxyTable: {
'/apidomain':{
target:'http://localhost:prot',//或ip或域名。
changeOrigin:true,
pathRewrite: {
'^/apido