2024-08-07 23:43:17 +00:00
|
|
|
|
|
|
|
if (!process.env.WORKER_CONNECTION_STRING) throw new Error("WORKER_CONNECTION_STRING was missing from env");
|
2024-08-07 01:13:58 +00:00
|
|
|
if (!process.env.POSTGREST_URL) throw new Error('Missing POSTGREST_URL env var');
|
|
|
|
if (!process.env.DISCORD_TOKEN) throw new Error('Missing DISCORD_TOKEN env var');
|
2024-08-07 23:43:17 +00:00
|
|
|
if (!process.env.DISCORD_CHANNEL_ID) throw new Error("DISCORD_CHANNEL_ID was missing from env");
|
|
|
|
if (!process.env.DISCORD_GUILD_ID) throw new Error("DISCORD_GUILD_ID was missing from env");
|
2024-08-07 01:13:58 +00:00
|
|
|
if (!process.env.AUTOMATION_USER_JWT) throw new Error('Missing AUTOMATION_USER_JWT env var');
|
|
|
|
const token = process.env.DISCORD_TOKEN!
|
|
|
|
const postgrestUrl = process.env.POSTGREST_URL!
|
2024-08-07 23:43:17 +00:00
|
|
|
const discordChannelId = process.env.DISCORD_CHANNEL_ID!
|
|
|
|
const discordGuildId = process.env.DISCORD_GUILD_ID!
|
2024-08-07 01:13:58 +00:00
|
|
|
const automationUserJwt = process.env.AUTOMATION_USER_JWT!
|
2024-08-07 23:43:17 +00:00
|
|
|
const connectionString = process.env.WORKER_CONNECTION_STRING!
|
|
|
|
|
|
|
|
console.log(`hello i am configs and configs.connectionString=${connectionString}`)
|
2024-08-07 01:13:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
export interface Config {
|
|
|
|
token: string;
|
|
|
|
postgrestUrl: string;
|
|
|
|
automationUserJwt: string;
|
2024-08-07 23:43:17 +00:00
|
|
|
discordGuildId: string;
|
|
|
|
discordChannelId: string;
|
|
|
|
connectionString: string;
|
2024-08-07 01:13:58 +00:00
|
|
|
}
|
2024-08-07 23:43:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
export const configs: Config = {
|
|
|
|
token,
|
|
|
|
postgrestUrl,
|
|
|
|
automationUserJwt,
|
|
|
|
discordGuildId,
|
|
|
|
discordChannelId,
|
|
|
|
connectionString,
|
|
|
|
}
|