Download src/lib/env.server.ts from caustino/publish: direct link, hf CLI and curl.
- Browser
- Download file 477 Bytes
-
https://huggingface.co/spaces/caustino/publish/resolve/main/src/lib/env.server.ts
- Command line
-
hf download hf://spaces/caustino/publish/src/lib/env.server.ts
-
curl -L -o env.server.ts https://huggingface.co/spaces/caustino/publish/resolve/main/src/lib/env.server.ts
477 Bytes
| export function env(key: string): string | undefined { | |
| const v = process.env[key]?.trim(); | |
| return v || undefined; | |
| } | |
| /** | |
| * Workspace preview vs deployed app. The deployer writes GROK_PROJECT_ID on | |
| * every publish; the sandbox preview never has it. Single source of truth for | |
| * the split — gate audience, gate endpoints and connector-token semantics all | |
| * key off this predicate. | |
| */ | |
| export function isWorkspacePreview(): boolean { | |
| return !env("GROK_PROJECT_ID"); | |
| } | |