mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 13:47:15 +08:00
feat: 开发服务器代理支持多目标
This commit is contained in:
24
web/settings/proxy-config.example.ts
Normal file
24
web/settings/proxy-config.example.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const proxyConfigMappings: Record<ProxyType, ProxyConfig> = {
|
||||
dev: [
|
||||
{
|
||||
prefix: '/api',
|
||||
target: 'http://localhost:8080'
|
||||
}
|
||||
],
|
||||
test: [
|
||||
{
|
||||
prefix: '/api',
|
||||
target: 'http://localhost:8080'
|
||||
}
|
||||
],
|
||||
prod: [
|
||||
{
|
||||
prefix: '/api',
|
||||
target: 'http://localhost:8080'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export function getProxyConfig(envType: ProxyType = 'dev'): ProxyConfig {
|
||||
return proxyConfigMappings[envType]
|
||||
}
|
||||
Reference in New Issue
Block a user