feat: 后端代理层(Jev 透传 + ASR 预留端点),前端支持代理模式
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 极简 .env 加载(不引 dotenv,与根仓库 scripts/verify-live.ts 风格一致)。
|
||||
* 只解析 KEY=VALUE 行,忽略注释与空行;任何输出都不打印 value。
|
||||
*/
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
export function loadEnvFile(path: URL): void {
|
||||
let raw: string;
|
||||
try {
|
||||
raw = readFileSync(path, 'utf8');
|
||||
} catch {
|
||||
return; // .env 不存在时静默跳过(允许用真实环境变量注入)
|
||||
}
|
||||
for (const line of raw.split('\n')) {
|
||||
const m = line.match(/^\s*([A-Z0-9_]+)\s*=\s*(.+?)\s*$/);
|
||||
if (m && !m[2].startsWith('#') && process.env[m[1]] === undefined) {
|
||||
process.env[m[1]] = m[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user