From 2a1a6d5299f8385063d3e737cf0baa7ee49863b5 Mon Sep 17 00:00:00 2001 From: David Baldwynn Date: Fri, 20 May 2016 14:11:37 -0700 Subject: [PATCH] fixed dotenv --- ecosystem.json | 8 ++++---- package.json | 1 + server.js | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ecosystem.json b/ecosystem.json index 5e4d5a17..89fd4dc5 100644 --- a/ecosystem.json +++ b/ecosystem.json @@ -1,9 +1,9 @@ { "apps" : [{ - "name" : "tellform", - "script" : "/usr/local/bin/grunt", - "instances" : "4", - "exec_mode" : "cluster" + "name" : "tellform", + "script" : "./node_modules/.bin/grunt", + "instances": "4", + "exec_mode": "cluster" }], "deploy" : { "stage" : { diff --git a/package.json b/package.json index 35e74bb5..6850f273 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "connect-mongo": "~0.8.2", "consolidate": "~0.13.1", "cookie-parser": "~1.4.0", + "dotenv": "^2.0.0", "email-verification": "whitef0x0/node-email-verification", "envfile": "^2.0.1", "express": "~4.13.3", diff --git a/server.js b/server.js index fb6192ed..c9214844 100755 --- a/server.js +++ b/server.js @@ -2,11 +2,16 @@ /** * Module dependencies. */ + +//Load ENV vars from .env +require('dotenv').config(); + var init = require('./config/init')(), config = require('./config/config'), mongoose = require('mongoose'), chalk = require('chalk'); + /** * Main application entry file. * Please note that the order of loading is important. @@ -50,5 +55,5 @@ console.log('--'); process.on('uncaughtException', function (err) { console.error((new Date).toUTCString() + ' uncaughtException:', err.message); console.error(err.stack); - process.exit(1) + process.exit(1); });