2017-10-23 23:13:53 +02:00
|
|
|
'use strict'
|
|
|
|
|
2020-05-01 20:12:24 +02:00
|
|
|
const {api, config} = require('./api')
|
2017-12-16 09:06:35 +01:00
|
|
|
|
|
|
|
api.listen(config.port, (err) => {
|
2020-04-30 15:48:06 +02:00
|
|
|
const {logger} = api.locals
|
2017-10-23 23:13:53 +02:00
|
|
|
if (err) {
|
2020-04-30 15:48:06 +02:00
|
|
|
logger.error(err)
|
|
|
|
process.exit(1)
|
2017-10-23 23:13:53 +02:00
|
|
|
} else {
|
2020-04-30 15:48:06 +02:00
|
|
|
logger.info(`Listening on ${config.hostname}:${config.port}.`)
|
2017-10-23 23:13:53 +02:00
|
|
|
}
|
|
|
|
})
|