ls-deno/config.ts
2022-10-11 12:20:25 -05:00

27 lines
489 B
TypeScript

import "$std/log/mod.ts";
export interface Config {
postgres: {
url: string;
};
mailgun: {
apiKey?: string;
domain?: string;
};
}
function envOrWarn(key: string, fallback?: string): string | undefined {
const val = Deno.env.get(key);
if (!val) console.warn(`${key} is not set!`);
return val || fallback;
}
export const config = {
postgres: {
url: envOrWarn(
"POSTGRES_URL",
"postgresql://postgres:@127.0.0.1:5432/lyricscreen",
),
},
};