fix: wait for core to be ready before listen (#3407)

This commit is contained in:
zyxd 2018-06-06 20:52:08 +04:00 committed by Pooya Parsa
parent 3c54d26c76
commit 3b2ed038da

View File

@ -120,7 +120,7 @@ export default class Nuxt {
}
listen(port = 3000, host = 'localhost') {
return new Promise((resolve, reject) => {
return this.ready().then(() => new Promise((resolve, reject) => {
const server = this.renderer.app.listen(
{ port, host, exclusive: false },
err => {
@ -155,7 +155,7 @@ export default class Nuxt {
// Add server.destroy(cb) method
enableDestroy(server)
})
}))
}
resolveAlias(_path) {