-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
41 lines (38 loc) · 1.37 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
proxy: {
"/user-service": {
target: "http://localhost:8080",
changeOrigin: true, // 다른 도메인으로의 요청 허용
},
'/api': {
target: 'http://localhost:8080', // 백엔드 서버 주소
changeOrigin: true, // 다른 도메인으로의 요청 허용
rewrite: (path) => path.replace(/^\/api/, '')
}, // '/api'를 백엔드 서버 경로에서 제거
// pathRewrite 설정 없이 '/api' 경로를 그대로 전달
'/study-group-service/api': {
target: 'http://localhost:8080', // 백엔드 서버 주소
changeOrigin: true, // 다른 도메인으로의 요청 허용
}, // pathRewrite 설정 없이 '/api' 경로를 그대로 전달
"/recruitment-service/api": {
target: "http://localhost:8080", // 백엔드 서버 주소
changeOrigin: true, // 다른 도메인으로의 요청 허용
},
"/schedule-service/api": {
target: "http://localhost:8080",
changeOrigin: true,
},
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});