base: Make run smarter when creating server
This commit is contained in:
parent
3dbcc18da8
commit
86394efb1f
1 changed files with 8 additions and 7 deletions
|
@ -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()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue