1 Star 0 Fork 0

jialin.zhou / big-event

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.js 607 Bytes
一键复制 编辑 原始数据 按行查看 历史
jialin.zhou 提交于 2024-03-07 10:04 . 注册登录代理
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'node:path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server:{
proxy:{
'/api':{ // 获取路径中包含了/api的请求
target: 'http://localhost:8080', // 后台服务所在的源
changeOrigin: true,
rewrite: (path)=>path.replace(/^\/api/,'')// 将/api替换为''
}
}
}
})
1
https://gitee.com/zhoujialin123/big-event.git
git@gitee.com:zhoujialin123/big-event.git
zhoujialin123
big-event
big-event
master

搜索帮助