2019-09-14 19:03:38 +00:00
|
|
|
import log from './api/log.mjs'
|
2019-02-19 11:34:52 +00:00
|
|
|
|
|
|
|
// Run the database script automatically.
|
2019-09-14 19:03:38 +00:00
|
|
|
import setup from './api/setup.mjs'
|
2019-02-19 11:34:52 +00:00
|
|
|
|
2019-09-13 13:33:10 +00:00
|
|
|
setup().catch(async (error) => {
|
|
|
|
log.error({ code: error.code, message: error.message }, 'Error while preparing database')
|
|
|
|
log.error('Unable to verify database integrity.')
|
|
|
|
log.warn('Continuing anyways')
|
|
|
|
// import('./api/config').then(module => {
|
|
|
|
// log.error(error, 'Error while preparing database')
|
|
|
|
// log.error({ config: module.default.get() }, 'config used')
|
|
|
|
// process.exit(1)
|
|
|
|
// })
|
|
|
|
}).then(() =>
|
2019-09-14 19:03:38 +00:00
|
|
|
import('./server.mjs')
|
2019-09-13 13:33:10 +00:00
|
|
|
).catch(error => {
|
|
|
|
log.error(error, 'Unknown error starting server')
|
2019-02-19 11:34:52 +00:00
|
|
|
})
|