chore: initialize clean metapi repository

This commit is contained in:
cita committed 2026-02-28 00:36:28 +08:00
commit 2ecc23730d
199 files changed
+46078

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
type ProxyEnv = Record<string, string | undefined>;
function normalizeTarget(raw: string): string {
return raw.trim().replace(/\/+$/, '');
}
export function resolveDevProxyTarget(env: ProxyEnv): string {
const explicit = normalizeTarget(env.DEV_PROXY_TARGET || env.VITE_DEV_PROXY_TARGET || '');
if (explicit) return explicit;
const port = (env.PORT || env.VITE_BACKEND_PORT || '').trim();
if (port) return `http://localhost:${port}`;
return 'http://localhost:4000';
}