get env variables
This commit is contained in:
parent
b16c2b395d
commit
75ae50a552
9
src/shared/lib/getEnvVar.ts
Normal file
9
src/shared/lib/getEnvVar.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export function getEnvVar(variable: string): string {
|
||||
const value = import.meta.env[variable];
|
||||
|
||||
if (typeof value === "string") {
|
||||
return value;
|
||||
} else {
|
||||
throw new Error(`Environment variable ${variable} is required`);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user