Skip to content

Commit

Permalink
fix(skeleton): return value instead of name from loadFromEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed May 17, 2024
1 parent 01f0c96 commit 31c0dfa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions skeleton/base/src/env-variables.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const loadFromEnv = (name: string): string => {
if (!process.env[name]) {
const value = process.env[name];

if (!value) {
throw new Error(`Env variable with name ${name} not found`);
}

return name;
return value;
};

export const envVariables = {
auth0Domain: loadFromEnv("AUTH0_DOMAIN"),
ses: {
accessKeyId: loadFromEnv("SES_ACCESS_KEY_ID"),
secretAccessKey: loadFromEnv("SES_SECRET_ACCESS_KEY"),
Expand Down

0 comments on commit 31c0dfa

Please sign in to comment.