Skip to content

Instantly share code, notes, and snippets.

@KATT
Forked from sibelius/config.ts
Last active July 1, 2019 22:45
Show Gist options
  • Save KATT/2f32a790939982eaa18d9cb5d62d5c7f to your computer and use it in GitHub Desktop.
Save KATT/2f32a790939982eaa18d9cb5d62d5c7f to your computer and use it in GitHub Desktop.
Keep all your process.env in a config file, so it is easy to check env vars available
import { cleanEnv, str, num, url } from 'envalid'
const env = cleanEnv(process.env, {
GRAPHQL_URL: url({
devDefault: 'http://localhost:4000/graphql',
}),
PORT: num({
devDefault: 3000,
}),
A: str(),
})
export default env;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment