Forked from std/API_URL
Public
Script
1
2
3
4
5
6
7
8
9
10
11
12
function envOrUndefined(key: string): string | undefined {
// try/catch prevents crashes if the script doesn't have env access
try {
return Deno.env.get("VALTOWN_API_URL");
} catch {}
}
export function getApiUrl(): string {
return envOrUndefined("VALTOWN_API_URL") ?? "https://api.val.town";
}
export const API_URL = getApiUrl();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
June 5, 2024