Files
hereconnect/services/tg-bot/src/config/env.ts
T

33 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-12-10 13:21:38 +02:00
if (!process.env.BOT_TOKEN) {
throw new Error("Необходимо указать BOT_TOKEN в переменных окружения.");
}
if (!process.env.READ_BASE_URL) {
throw new Error("Необходимо указать READ_BASE_URL в переменных окружения.");
}
2024-12-15 02:16:43 +02:00
if (!process.env.APP_BASE_URL) {
throw new Error("Необходимо указать APP_BASE_URL в переменных окружения.");
}
2024-12-12 17:45:01 +02:00
if (!process.env.API_URL) {
throw new Error("Environment variable API_URL is not set");
}
2024-12-15 03:14:39 +02:00
if (!process.env.PUBLIC_API_URL) {
throw new Error("Environment variable PUBLIC_API_URL is not set");
}
if (!process.env.HEARTBEAT_INTERVAL) {
throw new Error("Environment variable HEARTBEAT_INTERVAL is not set");
}
2024-12-10 13:21:38 +02:00
export const env = {
TELEGRAM_BOT_TOKEN: process.env.BOT_TOKEN,
READ_BASE_URL: process.env.READ_BASE_URL,
APP_BASE_URL: process.env.APP_BASE_URL,
2024-12-12 17:45:01 +02:00
API_URL: process.env.API_URL,
2024-12-15 03:14:39 +02:00
PUBLIC_API_URL: process.env.PUBLIC_API_URL,
HEARTBEAT_INTERVAL: parseInt(process.env.HEARTBEAT_INTERVAL, 10),
2024-12-10 13:21:38 +02:00
} as const;