2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 开发服务器代理支持多目标

This commit is contained in:
耗子
2024-10-20 19:55:14 +08:00
parent d51d11f460
commit 892f91be3e
3 changed files with 32 additions and 23 deletions

View 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]
}