fp/services/htmx/config.ts

21 lines
355 B
TypeScript
Raw Normal View History

2024-12-12 07:23:46 +00:00
const requiredEnvVars = [
'PORT'
] as const;
const getEnvVar = (key: typeof requiredEnvVars[number]): string => {
const value = process.env[key];
if (!value) {
throw new Error(`Missing ${key} env var`);
}
return value;
};
export interface Config {
port: number;
}
export const configs: Config = {
port: parseInt(getEnvVar('PORT'))
}