Skip to content

Commit 970207b

Browse files
Merge pull request #108 from arcatdmz/fix-env-vars-for-windows
Use env-cmd to load .env file
2 parents 89cc04f + 3f7355e commit 970207b

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
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

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ First, clone the repository and cd into it.
309309

310310
* `cp .env.sample .env`
311311
* Fill in the blanks in `.env`
312-
* `source .env` or `bash .env`
313-
314-
Or use [autoenv](https://github.com/kennethreitz/autoenv).
315312

316313
* `npm install`
317314
* `npm start` Start express server locally

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)