Commit 284481336aff35c7602753a00299a59ab2c529b3
configuration
Michael Williams committed on 11/28/2015, 8:42:03 AMParent: 797539afe1ecc1750ba1b41a253a250e56b5b7ca
Files changed
README.md | changed |
app/package.json | changed |
app/config-browser.js | added |
app/config.js | added |
package.json | changed |
config/defaults.js | added |
config/development.js | added |
config/production.js | added |
README.md | ||
---|---|---|
@@ -26,10 +26,10 @@ | ||
26 | 26 | - `/app/thing/views/thing-list.css` |
27 | 27 | - `/app/thing/tests/views/thing-list.js` |
28 | 28 | - `/app/list-view/index.js` |
29 | 29 | - always require top-down (`require('things/schema')`) instead of relative. |
30 | +- configuration: `app/config.js` and [evalify](https://www.npmjs.org/package/evalify) | |
30 | 31 | - `/config/{ NODE_ENV }.js` |
31 | -- configuration: [feathers-configuration](https://www.npmjs.org/package/feathers-configuration) | |
32 | 32 | - data model: [tcomb](https://github.com/gcanti/tcomb) |
33 | 33 | - database: [knex](https://www.npmjs.com/package/knex) |
34 | 34 | - data validator: [tcomb-validator](https://github.com/gcanti/tcomb-validation) |
35 | 35 | - api service: [feathers-knex](https://www.npmjs.com/package/feathers-knex) |
app/package.json | ||
---|---|---|
@@ -1,5 +1,6 @@ | ||
1 | 1 | { |
2 | 2 | "browser": { |
3 | - "./api": "./clients" | |
3 | + "./api.js": "./clients/index.js", | |
4 | + "./config.js": "./config-browser.js" | |
4 | 5 | } |
5 | 6 | } |
app/config-browser.js | ||
---|---|---|
@@ -1,0 +1,3 @@ | ||
1 | +const config = require('./config') | |
2 | + | |
3 | +module.exports = config.browser |
app/config.js | ||
---|---|---|
@@ -1,0 +1,14 @@ | ||
1 | +const { join } = require('path') | |
2 | + | |
3 | +const configDir = join(__dirname, '..', 'config') | |
4 | +const nodeEnv = process.env.NODE_ENV || 'development' | |
5 | + | |
6 | +const defaults = require(join(configDir, 'defaults')) | |
7 | +const envConfig = require(join(configDir, nodeEnv)) | |
8 | + | |
9 | +const config = { | |
10 | + ...defaults, | |
11 | + ...envConfig | |
12 | +} | |
13 | + | |
14 | +module.exports = config |
package.json | ||
---|---|---|
@@ -58,8 +58,9 @@ | ||
58 | 58 | "babel-plugin-transform-object-rest-spread": "^6.1.18", |
59 | 59 | "babel-preset-es2015": "^6.1.18", |
60 | 60 | "babel-preset-react": "^6.1.18", |
61 | 61 | "babelify": "^7.2.0", |
62 | + "evalify": "^1.0.1", | |
62 | 63 | "feathers": "^1.2.0", |
63 | 64 | "lnfs-cli": "^1.0.1", |
64 | 65 | "npm-run-all": "^1.3.2", |
65 | 66 | "ramda": "^0.18.0", |
Built with git-ssb-web