forked from badges/shields
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
33 lines (26 loc) · 773 Bytes
/
server.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
31
32
33
'use strict'
require('dotenv').config()
// Set up Sentry reporting as early in the process as possible.
const Raven = require('raven')
const serverSecrets = require('./lib/server-secrets')
Raven.config(process.env.SENTRY_DSN || serverSecrets.sentry_dsn).install()
Raven.disableConsoleAlerts()
const config = require('config').util.toObject()
if (+process.argv[2]) {
config.public.bind.port = +process.argv[2]
}
if (process.argv[3]) {
config.public.bind.address = process.argv[3]
}
console.log('Configuration:')
console.dir(config.public, { depth: null })
const Server = require('./lib/server')
const server = (module.exports = new Server(config))
;(async () => {
try {
await server.start()
} catch (e) {
console.error(e)
process.exit(1)
}
})()