-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
run.js
30 lines (25 loc) · 644 Bytes
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require('./rollbar')
module.exports = run
const extend = require('xtend')
const LiveUpdater = require('./liveupdater')
const minimist = require('minimist')
const Site = require('./')
const argv = minimist(process.argv.slice(2))
/**
* Run the given server, passing in command line options as options.
* @param {function(*)} ServerConstructor
*/
function run (runServer) {
// Create and start the server
runServer(extend(argv), function (err) {
if (err) {
console.error('Error during startup. Abort.')
console.error(err.stack)
process.exit(1)
}
})
}
if (!module.parent) {
run(Site)
run(LiveUpdater)
}