ls-deno/config.ts

25 lines
462 B
TypeScript
Raw Normal View History

2022-10-07 23:22:35 -05:00
export interface Config {
postgres: {
url: string;
};
mailgun: {
apiKey?: string;
domain?: string;
};
}
2022-10-07 21:55:20 -05:00
2022-10-07 23:22:35 -05:00
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;
}
2022-10-07 21:55:20 -05:00
2022-10-07 23:22:35 -05:00
export const config = {
postgres: {
url: envOrWarn(
"POSTGRES_URL",
"postgresql://postgres:@127.0.0.1:5432/lyricscreen",
),
},
};