Skip to content

Commit

Permalink
Merge pull request #377 from fastify/chore/port
Browse files Browse the repository at this point in the history
chore: replace use of deprecated variadic `listen()`
  • Loading branch information
Uzlopak committed Aug 5, 2022
2 parents 8707f1b + 14755b8 commit cc91d23
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -63,7 +63,7 @@ fastify.post('/', async function (req, reply) {
reply.send()
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
Expand Down
2 changes: 1 addition & 1 deletion callback.md
Expand Up @@ -56,7 +56,7 @@ fastify.post('/', function (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
2 changes: 1 addition & 1 deletion examples/example-legacy-validation.js
Expand Up @@ -24,7 +24,7 @@ fastify.post('/upload/files', {
reply.send('done')
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
2 changes: 1 addition & 1 deletion examples/example-legacy.js
Expand Up @@ -31,7 +31,7 @@ fastify.post('/upload/files', function (req, reply) {
}
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
2 changes: 1 addition & 1 deletion examples/example-validation.js
Expand Up @@ -23,7 +23,7 @@ fastify.post('/upload/files', {
reply.send('done')
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
2 changes: 1 addition & 1 deletion examples/example.js
Expand Up @@ -58,7 +58,7 @@ fastify.post('/upload/files', async function (req, reply) {
reply.send()
})

fastify.listen(3000, err => {
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})

0 comments on commit cc91d23

Please sign in to comment.