Skip to content

Commit

Permalink
Merge pull request #1237 from yuki24/fix-start-script
Browse files Browse the repository at this point in the history
Do not fail when .env is missing in production/staging
  • Loading branch information
yuki24 authored Aug 16, 2017
2 parents 6a1ac4c + 97710c1 commit f8d4cef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ const env = require('node-env-file')

if (process.env.NODE_ENV === 'test') {
env('./.env.test')

// Other envs: development, staging, production
} else {
} else if (process.env.NODE_ENV === undefined || process.env.NODE_ENV === 'development') {
// If NODE_ENV is unset, assume that it's a local setup
env('./.env')
} else {
// Other envs: staging, production
env('./.env', { raise: false })
}

require('./boot')

0 comments on commit f8d4cef

Please sign in to comment.