From 70508ff4aa46fbddadf79f5eebe9bc5033a44e35 Mon Sep 17 00:00:00 2001 From: Waqas Ajaz Date: Sat, 17 Mar 2018 22:20:31 +0500 Subject: [PATCH] Added fail safe way of loading config file for prod build --- config/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.js b/config/config.js index 3ca2c9ff..5cd58f3a 100644 --- a/config/config.js +++ b/config/config.js @@ -1,7 +1,9 @@ import Joi from 'joi'; +const path = require('path'); // require and configure dotenv, will load vars in .env in PROCESS.ENV -require('dotenv').config(); +require('dotenv').config({ path: path.join(__dirname, '../.env') }); + // define validation for all the env vars const envVarsSchema = Joi.object({