@@ -23,44 +23,39 @@ export default defineConfig(({ mode }) => {
23
23
proxy : {
24
24
'/user-service' : {
25
25
target : env . VITE_USER_SERVICE ,
26
- rewrite : ( path : string ) =>
27
- String ( path ) . replace && String ( path ) . replace ( / ^ \/ u s e r - s e r v i c e / , '' ) ,
26
+ rewrite : ( path : string ) => path ?. replace && path . replace ( / ^ \/ u s e r - s e r v i c e / , '' ) ,
28
27
changeOrigin : true ,
29
28
cookiePathRewrite : {
30
29
'*' : '/' ,
31
30
} ,
32
31
} ,
33
32
'/question-service' : {
34
33
target : env . VITE_QUESTION_SERVICE ,
35
- rewrite : ( path : string ) =>
36
- String ( path ) . replace && String ( path ) . replace ( / ^ \/ q u e s t i o n - s e r v i c e / , '' ) ,
34
+ rewrite : ( path : string ) => path ?. replace && path . replace ( / ^ \/ q u e s t i o n - s e r v i c e / , '' ) ,
37
35
changeOrigin : true ,
38
36
cookiePathRewrite : {
39
37
'*' : '/' ,
40
38
} ,
41
39
} ,
42
40
'/collaboration-service' : {
43
41
target : env . VITE_COLLAB_SERVICE ,
44
- rewrite : ( path : string ) =>
45
- String ( path ) . replace && String ( path ) . replace ( / ^ \/ c o l l a b o r a t i o n - s e r v i c e / , '' ) ,
42
+ rewrite : ( path : string ) => path ?. replace && path . replace ( / ^ \/ c o l l a b o r a t i o n - s e r v i c e / , '' ) ,
46
43
changeOrigin : true ,
47
44
cookiePathRewrite : {
48
45
'*' : '/' ,
49
46
} ,
50
47
} ,
51
48
'/matching-service' : {
52
49
target : env . VITE_MATCHING_SERVICE ,
53
- rewrite : ( path : string ) =>
54
- String ( path ) . replace && String ( path ) . replace ( / ^ \/ m a t c h i n g - s e r v i c e / , '' ) ,
50
+ rewrite : ( path : string ) => path ?. replace && path . replace ( / ^ \/ m a t c h i n g - s e r v i c e / , '' ) ,
55
51
changeOrigin : true ,
56
52
cookiePathRewrite : {
57
53
'*' : '/' ,
58
54
} ,
59
55
} ,
60
56
'/collab-ws' : {
61
57
target : `${ env . VITE_COLLAB_SERVICE . replace ( 'http' , 'ws' ) } ` ,
62
- rewrite : ( path : string ) =>
63
- String ( path ) . replace && String ( path ) . replace ( / \/ c o l l a b - w s / , '' ) ,
58
+ rewrite : ( path : string ) => path ?. replace && path . replace ( / \/ c o l l a b - w s / , '' ) ,
64
59
ws : true ,
65
60
} ,
66
61
'/matching-socket/' : {
0 commit comments