format for latest standard

This commit is contained in:
Josh Harvey 2018-03-10 18:59:40 +00:00
parent 4108efd9c7
commit c2af183911
77 changed files with 1697 additions and 1693 deletions

View file

@ -24,8 +24,8 @@ function run () {
}
const runner = () => runOnce()
.then(() => clearInterval(handler))
.catch(errorHandler)
.then(() => clearInterval(handler))
.catch(errorHandler)
const handler = setInterval(runner, 10000)
return runner()
@ -33,35 +33,35 @@ function run () {
function runOnce () {
return settingsLoader.loadLatest()
.then(settings => {
poller.start(settings)
.then(settings => {
poller.start(settings)
const httpsServerOptions = {
key: fs.readFileSync(options.keyPath),
cert: fs.readFileSync(options.certPath),
requestCert: true,
rejectUnauthorized: false
}
const httpsServerOptions = {
key: fs.readFileSync(options.keyPath),
cert: fs.readFileSync(options.certPath),
requestCert: true,
rejectUnauthorized: false
}
const server = devMode
? http.createServer(routes.app)
: https.createServer(httpsServerOptions, routes.app)
const server = devMode
? http.createServer(routes.app)
: https.createServer(httpsServerOptions, routes.app)
const port = argv.port || 3000
const localPort = 3030
const localServer = http.createServer(routes.localApp)
const port = argv.port || 3000
const localPort = 3030
const localServer = http.createServer(routes.localApp)
if (options.devMode) logger.info('In dev mode')
if (options.devMode) logger.info('In dev mode')
server.listen(port, () => {
console.log('lamassu-server listening on port ' +
server.listen(port, () => {
console.log('lamassu-server listening on port ' +
port + ' ' + (devMode ? '(http)' : '(https)'))
})
})
localServer.listen(localPort, 'localhost', () => {
console.log('lamassu-server listening on local port ' + localPort)
localServer.listen(localPort, 'localhost', () => {
console.log('lamassu-server listening on local port ' + localPort)
})
})
})
}
module.exports = {run}