the-road-to-graphql / fullstack-apollo-express-postgresql-boilerplate

💥 A sophisticated GraphQL with Apollo, Express and PostgreSQL boilerplate project.
https://roadtoreact.com
MIT License
1.2k stars 261 forks source link

Server: Dotenv #8

Closed rwieruch closed 6 years ago

rwieruch commented 6 years ago

At the moment, the dotenv setup happens in a separate file: src/env.js. This file is imported in the src/index.js file for initializing all the environment variables from the .env file. Is there a way to have the initialization in the src/index.js file so that the src/models/index.js file has access to the process.env variables? In my case, these variables turned out to be undefined all the time.

isidroamv commented 6 years ago

Check PR #12 please.