Files
shields/server.js
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

35 lines
815 B
JavaScript

'use strict'
/* eslint-disable import/order */
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('./core/server/server')
const server = (module.exports = new Server(config))
;(async () => {
try {
await server.start()
} catch (e) {
console.error(e)
process.exit(1)
}
})()