feat: add vditor locally
This commit is contained in:
@@ -12,14 +12,13 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "http://localhost:8080", // 后端服务器地址
|
||||
target: "http://localhost:8080",
|
||||
changeOrigin: true, // 允许跨域
|
||||
rewrite: (path) => path.replace(/^\/api/, ""), // 重写路径,去掉 /api 前缀
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
},
|
||||
"/proxy": {
|
||||
target: "http://localhost:3000", // 代理服务器的地址
|
||||
changeOrigin: true, // 必须设置为 true,才能避免跨域问题
|
||||
// rewrite: (path) => path.replace(/^\/proxy/, ''), // 重写路径,去掉 /api 前缀
|
||||
target: "http://localhost:3000",
|
||||
changeOrigin: true,
|
||||
},
|
||||
"/online": {
|
||||
target: "ws://localhost:8080",
|
||||
@@ -31,6 +30,12 @@ export default defineConfig({
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
"/vditor": {
|
||||
target: "http://localhost:5173",
|
||||
rewrite: (path) => {
|
||||
return path.replace(/^\/vditor/, "/node_modules/vditor");
|
||||
},
|
||||
},
|
||||
},
|
||||
host: "0.0.0.0",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user