Skip to content

Commit

Permalink
Merge pull request alvarcarto#108 from arcatdmz/fix-env-vars-for-windows
Browse files Browse the repository at this point in the history
Use env-cmd to load .env file
  • Loading branch information
kimmobrunfeldt authored Nov 14, 2019
2 parents 89cc04f + 3f7355e commit 970207b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
12 changes: 4 additions & 8 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

# Guide:
#
# 1. Copy this file to .env
Expand All @@ -8,11 +6,9 @@
#
# 2. Fill the blanks

export NODE_ENV=development
export PORT=9000
export ALLOW_HTTP=true
NODE_ENV=development
PORT=9000
ALLOW_HTTP=true

# Warning: PDF rendering does not work in Chrome when it is in headed mode.
export DEBUG_MODE=false

echo "Environment variables set!"
DEBUG_MODE=false
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@ First, clone the repository and cd into it.

* `cp .env.sample .env`
* Fill in the blanks in `.env`
* `source .env` or `bash .env`

Or use [autoenv](https://github.com/kennethreitz/autoenv).

* `npm install`
* `npm start` Start express server locally
Expand Down
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"node": "10.x.x"
},
"scripts": {
"start": "nodemon --watch ./src -e js src/index.js",
"start": "env-cmd nodemon --watch ./src -e js src/index.js",
"test": "mocha --timeout 10000 && npm run lint",
"lint": "eslint ."
},
Expand Down Expand Up @@ -38,6 +38,7 @@
},
"devDependencies": {
"chai": "^4.1.2",
"env-cmd": "^9.0.1",
"eslint": "^4.8.0",
"eslint-config-airbnb-base": "^12.0.2",
"eslint-plugin-import": "^2.7.0",
Expand Down

0 comments on commit 970207b

Please sign in to comment.