18 lines
687 B
TypeScript
18 lines
687 B
TypeScript
function required(name: string): string {
|
|
const v = process.env[name];
|
|
if (!v) throw new Error(`Environment variable ${name} is missing`);
|
|
return v;
|
|
}
|
|
|
|
export const config = {
|
|
databaseUrl: required('DATABASE_URL'),
|
|
port: Number(process.env.PORT ?? 8090),
|
|
host: process.env.HOST ?? '0.0.0.0',
|
|
/** Root of the NAS mount, e.g. /mnt/bizmatch-nas */
|
|
nasRoot: process.env.NAS_ROOT ?? '/mnt/bizmatch-nas',
|
|
/** Directory names directly below NAS_ROOT, one per business status */
|
|
nasDirActive: process.env.NAS_DIR_ACTIVE ?? 'AAA = ACTIVE',
|
|
nasDirSold: process.env.NAS_DIR_SOLD ?? 'AAA = SOLD',
|
|
nasDirInactive: process.env.NAS_DIR_INACTIVE ?? 'AAA = INACTIVE',
|
|
} as const;
|