git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit d7bb4a1cb809f7db3135cc7d21052d9c2636bd45

commonjs compatible exports

Michael Williams committed on 1/8/2016, 3:18:27 AM
Parent: 12b89c112b20cdf2aef4454f6c59cd52a630d9d8

Files changed

api.jschanged
app/api.jschanged
app/config.jschanged
app/static.jschanged
render.jschanged
static.jschanged
api.jsView
@@ -1,8 +1,8 @@
11 require('babel-core/register')
22
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')
55 const Url = require('url')
66
77 const server = createApi(config)
88
app/api.jsView
@@ -15,9 +15,11 @@
1515 bulk(__dirname, '*/services/*.js')
1616 )
1717 }
1818
19-export default function createServer (config) {
19+export default module.exports = createApi
20+
21+function createApi (config) {
2022 const app = feathers()
2123 .configure(rest())
2224 .configure(hooks())
2325 .use(bodyParser.json())
app/config.jsView
@@ -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.jsView
@@ -1,7 +1,7 @@
11 import http from 'http'
22
3-export default function createStatic (config) {
3+export default module.exports = function createStatic (config) {
44 const ecstatic = config.livereload ?
55 require('ecstatic-lr') : require('ecstatic')
66
77 return http.createServer(
render.jsView
@@ -1,9 +1,9 @@
11 require('babel-core/register')
22 require('css-modules-require-hook')
33
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')
66 const Url = require('url')
77
88 const server = createRender(config)
99
static.jsView
@@ -1,8 +1,8 @@
11 require('babel-core/register')
22
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')
55 const Url = require('url')
66
77 const server = createStatic(config)
88

Built with git-ssb-web