mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
11 lines
318 B
TypeScript
11 lines
318 B
TypeScript
import { getClientEnv, getServerEnv } from "./env"
|
|
import type { EnvKey } from "./env"
|
|
|
|
export default function getEnv(key: EnvKey): string {
|
|
if (key.startsWith("NEXT_PUBLIC_")) {
|
|
const clientKey = key.replace("NEXT_PUBLIC_", "") as any
|
|
return getClientEnv(clientKey)
|
|
}
|
|
return getServerEnv(key as any)
|
|
}
|