git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 284481336aff35c7602753a00299a59ab2c529b3

configuration

Michael Williams committed on 11/28/2015, 8:42:03 AM
Parent: 797539afe1ecc1750ba1b41a253a250e56b5b7ca

Files changed

README.mdchanged
app/package.jsonchanged
app/config-browser.jsadded
app/config.jsadded
package.jsonchanged
config/defaults.jsadded
config/development.jsadded
config/production.jsadded
README.mdView
@@ -26,10 +26,10 @@
2626 - `/app/thing/views/thing-list.css`
2727 - `/app/thing/tests/views/thing-list.js`
2828 - `/app/list-view/index.js`
2929 - always require top-down (`require('things/schema')`) instead of relative.
30+- configuration: `app/config.js` and [evalify](https://www.npmjs.org/package/evalify)
3031 - `/config/{ NODE_ENV }.js`
31-- configuration: [feathers-configuration](https://www.npmjs.org/package/feathers-configuration)
3232 - data model: [tcomb](https://github.com/gcanti/tcomb)
3333 - database: [knex](https://www.npmjs.com/package/knex)
3434 - data validator: [tcomb-validator](https://github.com/gcanti/tcomb-validation)
3535 - api service: [feathers-knex](https://www.npmjs.com/package/feathers-knex)
app/package.jsonView
@@ -1,5 +1,6 @@
11 {
22 "browser": {
3- "./api": "./clients"
3+ "./api.js": "./clients/index.js",
4+ "./config.js": "./config-browser.js"
45 }
56 }
app/config-browser.jsView
@@ -1,0 +1,3 @@
1+const config = require('./config')
2+
3+module.exports = config.browser
app/config.jsView
@@ -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.jsonView
@@ -58,8 +58,9 @@
5858 "babel-plugin-transform-object-rest-spread": "^6.1.18",
5959 "babel-preset-es2015": "^6.1.18",
6060 "babel-preset-react": "^6.1.18",
6161 "babelify": "^7.2.0",
62+ "evalify": "^1.0.1",
6263 "feathers": "^1.2.0",
6364 "lnfs-cli": "^1.0.1",
6465 "npm-run-all": "^1.3.2",
6566 "ramda": "^0.18.0",
config/defaults.jsView
@@ -1,0 +1,9 @@
1+const { join } = require('path')
2+
3+module.exports = {
4+ services: {
5+ static: {
6+ root: join(__dirname, 'assets')
7+ }
8+ }
9+}
config/development.jsView
@@ -1,0 +1,2 @@
1+module.exports = {
2+}
config/production.jsView
@@ -1,0 +1,3 @@
1+module.exports = {
2+
3+}

Built with git-ssb-web