Skip to content

Commit 5dc24f0

Browse files
committed
Use env-cmd to load .env files
1 parent 098dff8 commit 5dc24f0

File tree

3 files changed

+43
-9
lines changed

3 files changed

+43
-9
lines changed

.env.sample

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/bin/bash
2-
31
# Guide:
42
#
53
# 1. Copy this file to .env
@@ -8,11 +6,9 @@
86
#
97
# 2. Fill the blanks
108

11-
export NODE_ENV=development
12-
export PORT=9000
13-
export ALLOW_HTTP=true
9+
NODE_ENV=development
10+
PORT=9000
11+
ALLOW_HTTP=true
1412

1513
# Warning: PDF rendering does not work in Chrome when it is in headed mode.
16-
export DEBUG_MODE=false
17-
18-
echo "Environment variables set!"
14+
DEBUG_MODE=false

package-lock.json

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"node": "10.x.x"
88
},
99
"scripts": {
10-
"start": "nodemon --watch ./src -e js src/index.js",
10+
"start": "env-cmd nodemon --watch ./src -e js src/index.js",
1111
"test": "mocha --timeout 10000 && npm run lint",
1212
"lint": "eslint ."
1313
},
@@ -38,6 +38,7 @@
3838
},
3939
"devDependencies": {
4040
"chai": "^4.1.2",
41+
"env-cmd": "^9.0.1",
4142
"eslint": "^4.8.0",
4243
"eslint-config-airbnb-base": "^12.0.2",
4344
"eslint-plugin-import": "^2.7.0",

0 commit comments

Comments
 (0)