Skip to content

Commit

Permalink
Merge pull request #157 from fastify/Fdawgs-patch-1
Browse files Browse the repository at this point in the history
docs(readme): replace use of deprecated variadic `listen()`
  • Loading branch information
Uzlopak authored Aug 5, 2022
2 parents 3a0452f + 249c667 commit b5f8741
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fastify.post('/foo', (req, reply) => {
})
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
Expand Down Expand Up @@ -154,7 +154,7 @@ fastify.post('/world', (req, reply) => {
})
})

fastify.listen(3000, function (err) {
fastify.listen({ port: 3000 }, function (err) {
if (err) {
fastify.log.error(err)
process.exit(1)
Expand Down Expand Up @@ -204,7 +204,7 @@ fastify.get('/streams', async (request, reply) => {
// { "output": ["#LOG: id is 1559985742035-0", "hello", "fastify is awesome"] }
})

fastify.listen(3000, function (err) {
fastify.listen({ port: 3000 }, function (err) {
if (err) {
fastify.log.error(err)
process.exit(1)
Expand Down

0 comments on commit b5f8741

Please sign in to comment.