Skip to content

Commit 3761977

Browse files
committed
APP_BACKEND_PRIMARY_KEY to NonEmptyString
1 parent a835717 commit 3761977

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/config.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,17 @@ export const ROOT_REDIRECT_URL = pipe(
359359
})
360360
);
361361

362-
export const APP_BACKEND_PRIMARY_KEY = getRequiredENVVar(
363-
"APP_BACKEND_PRIMARY_KEY"
362+
export const APP_BACKEND_PRIMARY_KEY = pipe(
363+
process.env.APP_BACKEND_PRIMARY_KEY,
364+
NonEmptyString.decode,
365+
E.getOrElseW((errs) => {
366+
log.error(
367+
`Missing or invalid APP_BACKEND_PRIMARY_KEY environment variable: ${readableReport(
368+
errs
369+
)}`
370+
);
371+
return process.exit(1);
372+
})
364373
);
365374

366375
export const APP_BACKEND_SECONDARY_KEY = pipe(

0 commit comments

Comments
 (0)