Created
January 29, 2020 09:30
-
-
Save raine/8e5bfd8dda040ae56a71f8f5549efa92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFromEnv(prop: string): string { | |
const val = process.env[prop] | |
if (val) { | |
return val | |
} else { | |
throw new Error(`Expected ${prop} to exist in env`) | |
} | |
} | |
type Config = { | |
GOOGLE_APPLICATION_CREDENTIALS: string | |
} | |
const config: Config = { | |
GOOGLE_APPLICATION_CREDENTIALS: getFromEnv('GOOGLE_APPLICATION_CREDENTIALS') | |
} | |
export default config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment