18 lines
578 B
TypeScript
18 lines
578 B
TypeScript
export interface EnvSettings {
|
|
BLITZCRANK_API_TOKEN: string;
|
|
BLITZCRANK_APP_ID: string;
|
|
}
|
|
|
|
export function readEnvSettings(): EnvSettings {
|
|
// TODO(DWM): I hate this.
|
|
const BLITZCRANK_API_TOKEN = process.env.BLITZCRANK_API_TOKEN;
|
|
if (BLITZCRANK_API_TOKEN === undefined || BLITZCRANK_API_TOKEN === null) {
|
|
throw TypeError();
|
|
}
|
|
const BLITZCRANK_APP_ID = process.env.BLITZCRANK_APP_ID;
|
|
if (BLITZCRANK_APP_ID === undefined || BLITZCRANK_APP_ID === null) {
|
|
throw TypeError();
|
|
}
|
|
return { BLITZCRANK_API_TOKEN, BLITZCRANK_APP_ID };
|
|
}
|