Files
hellogithub-vue/vue.config.js
2023-07-07 21:39:51 +08:00

62 lines
1.6 KiB
JavaScript

require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true,
// lintOnSave: false
// })
module.exports = {
runtimeCompiler: true,
// 关闭语法检查
lintOnSave:false,
devServer: {
// host: 'localhost', // 本地域名/ip地址
// port: '8080', // 端口号
proxy: {
'/github': {
//后端接口的baseurl
target: 'https://api.github.com/repos',
//是否允许跨域
changeOrigin: true,
// ws: true, //是否代理 websockets
// secure: true,
// 'secure': true,
headers:{
Connection:"kepp-alive"
},
pathRewrite: {
//这里的作用是使用去掉api
'^/github': ''
}
},
'/upload': {
//后端接口的baseurl
target: 'http://localhost:8082/helloGithub_war_exploded',
//是否允许跨域
changeOrigin: true,
headers:{
Connection:"kepp-alive"
},
pathRewrite: {
//这里的作用是使用去掉api
'^/upload': ''
}
},
'/api': {
//后端接口的baseurl
target: 'http://localhost:8082/helloGithub_war_exploded',
//是否允许跨域
changeOrigin: true,
// ws: true, //是否代理 websockets
// secure: true,
// 'secure': true,
headers:{
Connection:"kepp-alive"
},
pathRewrite: {
//这里的作用是使用去掉api
'^/api': ''
}
},
}
}
}