Commit d7bb4a1cb809f7db3135cc7d21052d9c2636bd45
commonjs compatible exports
Michael Williams committed on 1/8/2016, 3:18:27 AMParent: 12b89c112b20cdf2aef4454f6c59cd52a630d9d8
Files changed
api.js | changed |
app/api.js | changed |
app/config.js | changed |
app/static.js | changed |
render.js | changed |
static.js | changed |
api.js | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 | require('babel-core/register') |
2 | 2 | |
3 | -const config = require('app/config').default | |
4 | -const createApi = require('app/api').default | |
3 | +const config = require('app/config') | |
4 | +const createApi = require('app/api') | |
5 | 5 | const Url = require('url') |
6 | 6 | |
7 | 7 | const server = createApi(config) |
8 | 8 |
app/api.js | ||
---|---|---|
@@ -15,9 +15,11 @@ | ||
15 | 15 | bulk(__dirname, '*/services/*.js') |
16 | 16 | ) |
17 | 17 | } |
18 | 18 | |
19 | -export default function createServer (config) { | |
19 | +export default module.exports = createApi | |
20 | + | |
21 | +function createApi (config) { | |
20 | 22 | const app = feathers() |
21 | 23 | .configure(rest()) |
22 | 24 | .configure(hooks()) |
23 | 25 | .use(bodyParser.json()) |
app/config.js | ||
---|---|---|
@@ -1,3 +1,2 @@ | ||
1 | -import getConfig from 'simple-rc' | |
2 | - | |
3 | -export default getConfig() | |
1 | +process.env.NODE_ENV = process.env.NODE_ENV || 'development' | |
2 | +module.exports = module.exports['default'] = require('simple-rc')() |
app/static.js | ||
---|---|---|
@@ -1,7 +1,7 @@ | ||
1 | 1 | import http from 'http' |
2 | 2 | |
3 | -export default function createStatic (config) { | |
3 | +export default module.exports = function createStatic (config) { | |
4 | 4 | const ecstatic = config.livereload ? |
5 | 5 | require('ecstatic-lr') : require('ecstatic') |
6 | 6 | |
7 | 7 | return http.createServer( |
render.js | ||
---|---|---|
@@ -1,9 +1,9 @@ | ||
1 | 1 | require('babel-core/register') |
2 | 2 | require('css-modules-require-hook') |
3 | 3 | |
4 | -const config = require('app/config').default | |
5 | -const createRender = require('app/render').default | |
4 | +const config = require('app/config') | |
5 | +const createRender = require('app/render') | |
6 | 6 | const Url = require('url') |
7 | 7 | |
8 | 8 | const server = createRender(config) |
9 | 9 |
static.js | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 | require('babel-core/register') |
2 | 2 | |
3 | -const config = require('app/config').default | |
4 | -const createStatic = require('app/static').default | |
3 | +const config = require('app/config') | |
4 | +const createStatic = require('app/static') | |
5 | 5 | const Url = require('url') |
6 | 6 | |
7 | 7 | const server = createStatic(config) |
8 | 8 |
Built with git-ssb-web