Skip to content

Commit

Permalink
confippet docs peer review. incorporated comments (#2)
Browse files Browse the repository at this point in the history
* review. incorporated peer review comments.

* docs. added meeting changes.

* docs. minor sections changes + titles.

* docs. updated name + package.json info.

* review. added text changes.

* review. added confippet link in markdown
  • Loading branch information
raydecastro authored and ananavati committed Sep 10, 2016
1 parent 4db80bc commit 6648e64
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
40 changes: 23 additions & 17 deletions samples/universal-react-node/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Electrode App Confippet
# Electrode app with Electrode Modules
- This repo is a sample Electrode app generated from `yo electrode` with Electrode modules

## Quickstart guide

- Confippet is built-in to electrode.
## Electrode Confippet
- [Confippet](https://github.com/electrode-io/electrode-confippet) is a versatile utility for managing your NodeJS application configuration. Its goal is customization and extensibility, but offers a preset config out of the box.
- Scaffold an electrode app using the following commands:

```
Expand All @@ -11,6 +11,7 @@ npm install -g generator-electrode
yo electrode
```

### Config Files
- Once the scaffolding is complete, open the following config files:

```
Expand All @@ -20,6 +21,7 @@ config
|_ production.json
```

### Development Environment
- Update the `config/development.json` to have the following settings:

```
Expand All @@ -42,6 +44,8 @@ config
```

- The above settings should show server log errors that may be beneficial for debugging, disable content encoding, and run the server in port 3000

### Production Environment
- Update the `config/production.json` to have the following settings:

```
Expand All @@ -66,27 +70,29 @@ config
- The above settings should disable server log errors, enable content encoding, and run the server in port 8000
- The `server` key related configs are from hapi.js. More config options can be found here: http://hapijs.com/api
- The `connections` key are electrode server specific: https://github.com/electrode-io/electrode-server/tree/master/lib/config
- Start the electrode app in `development` environment:
- Keys that exist in the `config/default.json` that are also in the other environment configs will be replaced by the environment specific versions

### Confippet Require
- In Electrode, the configurations are loaded from `server/index.js` at this line:

```
export NODE_ENV=development
gulp hot
const config = require("electrode-confippet").config;
const staticPathsDecor = require("electrode-static-paths");
require("electrode-server")(config, [staticPathsDecor()]);
```

- Start the electrode app in `production` environment:
### Running Electrode app
- Start the electrode app in `development` environment:

```
export NODE_ENV=production
gulp hot
NODE_ENV=development gulp hot
```

- Running in the selected environment should load the appropriate configuration settings
- Keys that exist in the `config/default.json` that are also in the other environment configs will be replaced by the environment specific versions
- In Electrode, the configurations are loaded from `server/index.js` at this line:
- Start the electrode app in `production` environment:

```
const config = require("electrode-confippet").config;
const staticPathsDecor = require("electrode-static-paths");
require("electrode-server")(config, [staticPathsDecor()]);
NODE_ENV=production gulp hot
```

- Running in the selected environment should load the appropriate configuration settings
13 changes: 4 additions & 9 deletions samples/universal-react-node/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"name": "electrode-app-confippet",
"name": "electrode-app-with-electrode-modules",
"version": "0.0.0",
"description": "electrode app confippet quickstart",
"homepage": "https://github.com/electrode-io/electrode-app-confippet",
"author": {
"name": "Ray de Castro",
"email": "[email protected]",
"url": ""
},
"description": "electrode app with electrode modules",
"homepage": "https://github.com/electrode-io",
"contributors": [],
"files": [
"lib"
Expand All @@ -20,7 +15,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/raydecastro/electrode-app-confippet.git"
"url": "https://github.com/electrode-io/electrode-app-with-electrode-modules.git"
},
"license": "MIT",
"scripts": {
Expand Down

0 comments on commit 6648e64

Please sign in to comment.