mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
fix: wait for core to be ready before listen (#3407)
This commit is contained in:
parent
3c54d26c76
commit
3b2ed038da
@ -120,7 +120,7 @@ export default class Nuxt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
listen(port = 3000, host = 'localhost') {
|
listen(port = 3000, host = 'localhost') {
|
||||||
return new Promise((resolve, reject) => {
|
return this.ready().then(() => new Promise((resolve, reject) => {
|
||||||
const server = this.renderer.app.listen(
|
const server = this.renderer.app.listen(
|
||||||
{ port, host, exclusive: false },
|
{ port, host, exclusive: false },
|
||||||
err => {
|
err => {
|
||||||
@ -155,7 +155,7 @@ export default class Nuxt {
|
|||||||
|
|
||||||
// Add server.destroy(cb) method
|
// Add server.destroy(cb) method
|
||||||
enableDestroy(server)
|
enableDestroy(server)
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
resolveAlias(_path) {
|
resolveAlias(_path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user