diff --git a/server/src/utils/env.ts b/server/src/utils/env.ts new file mode 100644 index 00000000..b4808b0c --- /dev/null +++ b/server/src/utils/env.ts @@ -0,0 +1,8 @@ +// Helper function to get environment variables and throw an error if they are not set +export const getEnvVariable = (key: string, defaultValue?: string): string => { + const value = process.env[key] || defaultValue; + if (!value) { + throw new Error(`Environment variable ${key} is not defined`); + } + return value; +}; \ No newline at end of file