Do not use Babel's register hook in production

This commit is contained in:
Michael Jackson
2016-05-16 15:12:49 -07:00
parent 9a3f72f3a6
commit 5f2615f2ed
10 changed files with 19 additions and 15 deletions

3
modules/register.js Normal file
View File

@ -0,0 +1,3 @@
require('babel-register')({
only: __dirname
})

20
modules/server/start.js Normal file
View File

@ -0,0 +1,20 @@
import { createServer } from './index'
const port = process.env.PORT || 5000
const registryURL = process.env.REGISTRY_URL || 'https://registry.npmjs.org'
const bowerBundle = process.env.BOWER_BUNDLE || '/bower.zip'
const redirectTTL = process.env.REDIRECT_TTL || 500
const autoIndex = !process.env.DISABLE_INDEX
const redisURL = process.env.REDIS_URL
const server = createServer({
registryURL,
bowerBundle,
redirectTTL,
autoIndex,
redisURL
})
server.listen(port, () => {
console.log('Server started on port %s, Ctrl+C to quit', port)
})