mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-14 12:43:43 +08:00
v4.3.0
This commit is contained in:
1
chat/config/index.ts
Normal file
1
chat/config/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './proxy'
|
||||
15
chat/config/proxy.ts
Normal file
15
chat/config/proxy.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { ProxyOptions } from 'vite'
|
||||
|
||||
export function createViteProxy(isOpenProxy: boolean, viteEnv: ImportMetaEnv) {
|
||||
if (!isOpenProxy) return
|
||||
|
||||
const proxy: Record<string, string | ProxyOptions> = {
|
||||
'/api': {
|
||||
target: viteEnv.VITE_APP_API_BASE_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: path => path.replace('/api/', '/'),
|
||||
},
|
||||
}
|
||||
|
||||
return proxy
|
||||
}
|
||||
Reference in New Issue
Block a user