oneuptime/Probe/Config.ts

27 lines
773 B
TypeScript
Raw Normal View History

2023-05-05 12:02:23 +00:00
import URL from 'Common/Types/API/URL';
2023-05-03 10:54:25 +00:00
import logger from 'CommonServer/Utils/Logger';
2023-05-05 12:02:23 +00:00
import ObjectID from 'Common/Types/ObjectID';
2023-05-03 10:54:25 +00:00
2023-05-05 12:02:23 +00:00
if (!process.env['PROBE_API_URL']) {
logger.error('PROBE_API_URL is not set');
2023-05-03 10:54:25 +00:00
process.exit();
}
export const PROBE_API_URL: URL = URL.fromString(process.env['PROBE_API_URL']);
export const PROBE_NAME: string | null = process.env['PROBE_NAME'] || null;
2023-05-05 12:02:23 +00:00
export const PROBE_DESCRIPTION: string | null =
process.env['PROBE_DESCRIPTION'] || null;
2023-05-03 10:54:25 +00:00
2023-05-05 12:02:23 +00:00
export const PROBE_ID: ObjectID | null = process.env['PROBE_ID']
? new ObjectID(process.env['PROBE_ID'])
: null;
2023-05-03 10:54:25 +00:00
2023-05-05 12:02:23 +00:00
if (!process.env['PROBE_KEY']) {
logger.error('PROBE_KEY is not set');
2023-05-03 10:54:25 +00:00
process.exit();
}
export const PROBE_KEY: string = process.env['PROBE_KEY'];