- 在server中配置proxy
server: {
host: true,
port: VITE_PORT as unknown as number,
https: false,
proxy: {
'/dev': 'http://10.63.80.113:8000'
}
}
-
配置之后,相当于将实际请求路径替换为 http://10.63.80.113:8000/dev
即将proxy对象中的键值加在键名之前
server: {
host: true,
port: VITE_PORT as unknown as number,
https: false,
proxy: {
'/dev': 'http://10.63.80.113:8000'
}
}
配置之后,相当于将实际请求路径替换为 http://10.63.80.113:8000/dev
即将proxy对象中的键值加在键名之前