Skip to content

Commit

Permalink
Add NODE_ENV variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuenges committed Nov 4, 2016
1 parent 7c3327c commit d338068
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
20 changes: 20 additions & 0 deletions docs/development-guide.md
Expand Up @@ -49,3 +49,23 @@ testing of [express.js](http://expressjs.com) based REST functionality use

+ [Keep commits clean](https://www.reviewboard.org/docs/codebase/dev/git/clean-commits/)
+ [Write good discriptions](https://www.reviewboard.org/docs/codebase/dev/writing-good-descriptions/)

## Development vs. Production

To make work easier and more comfortable there are two different modes for the code. These are `development`
mode and `production mode`. `development` mode can be used for e.g. avoiding to use a token to use the API.
To start the server in `development` mode enter

$ npm run dev

To run in `production` mode simply type

$ npm start

The development mode is stored in (and can be accessed by) `process.env.NODE_ENV`.

## Miscellaneous Commands

Automatically fix all files (ESLint):

$ npm run eslint
12 changes: 9 additions & 3 deletions package.json
@@ -1,17 +1,23 @@
{
"name": "arrow",
"version": "1.0.0",
"license": "AGPL",
"version": "0.0.1",
"license": "AGPL-1.0",
"description": "Description that needs to be changed some time soon",
"repository": "https://github.com/amos-ws16/amos-ws16-aibot",
"devDependencies": {
"buster": "^0.7.18",
"coveralls": "^2.11.14",
"eslint": "^3.9.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-promise": "^3.3.0",
"eslint-plugin-standard": "^2.0.1",
"istanbul": "^0.4.5"
"istanbul": "^0.4.5",
"cross-env": "^3.1.3"
},
"scripts": {
"eslint": "eslint --fix **/*.js",
"dev": "cross-env NODE_ENV=development node ./lib/mylib.js",
"start": "cross-env NODE_ENV=production node ./lib/mylib.js",
"test": "eslint **/*.js && buster-test",
"cover": "istanbul cover buster-test",
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls"
Expand Down

0 comments on commit d338068

Please sign in to comment.