Skip to content

Commit

Permalink
Support latest fastify-v5.0.0.alpha.2 (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina authored Jul 1, 2024
1 parent ae7904b commit 9ccfba1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ function wrapServer (server) {
const _listen = server.listen.bind(server)

server.listen = (...args) => {
const cb = args[args.length - 1]
return server.listening ? cb() : _listen(...args)
if (server.listening) {
server.emit('listening')
} else {
return _listen(...args)
}
}

server[closingServer] = false
Expand Down

0 comments on commit 9ccfba1

Please sign in to comment.