// Our modules
import createServer from './server'
import { logger } from './util'
import { thinky } from './db'

const PORT = 8080

// Wait for DB to initialize
thinky.dbReady().then(() => {
  logger.info('Database ready, starting server...')
  // Start server
  createServer().then(app => {
    app.listen(PORT, () => {
      logger.info(`🌍  acuity-backend is listening at http://localhost:${PORT}`)
    })
  })
})

@@ -402,16 +402,128 @@
 %0A    %7D)%0A
-  %7D
+%0A    // catch errors%0A  %7D).catch(e =%3E %7B%0A    logger.error(e)%0A    process.exit()%0A  %7D)%0A%7D).catch(e =%3E %7B%0A  logger.error(e
 )%0A%7D)%0A

Add error catching