diff --git a/base/server.mjs b/base/server.mjs index 5b25fcf..f916053 100644 --- a/base/server.mjs +++ b/base/server.mjs @@ -43,9 +43,6 @@ export default class Server { // Create our server this.flaska = new Flaska(this.flaskaOptions, this.http) - // Create our database pool - this.runCreateDatabase() - // configure our server if (config.get('NODE_ENV') === 'development') { this.flaska.devMode() @@ -121,9 +118,13 @@ export default class Server { } run() { - this.runCreateServer() - this.runRegisterRoutes() - - return this.runStartListen() + return Promise.all([ + this.runCreateServer(), + this.runCreateDatabase(), + ]).then(() => { + return this.runRegisterRoutes() + }).then(() => { + return this.runStartListen() + }) } }