diff --git a/README.md b/README.md index 9f4f8903..7b0f6a60 100644 --- a/README.md +++ b/README.md @@ -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}`) }) diff --git a/callback.md b/callback.md index 17f9052a..00e01335 100644 --- a/callback.md +++ b/callback.md @@ -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}`) }) diff --git a/examples/example-legacy-validation.js b/examples/example-legacy-validation.js index 35794e1f..40b38b16 100644 --- a/examples/example-legacy-validation.js +++ b/examples/example-legacy-validation.js @@ -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}`) }) diff --git a/examples/example-legacy.js b/examples/example-legacy.js index 61164271..fe90b777 100644 --- a/examples/example-legacy.js +++ b/examples/example-legacy.js @@ -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}`) }) diff --git a/examples/example-validation.js b/examples/example-validation.js index 705245f5..fe0326e0 100644 --- a/examples/example-validation.js +++ b/examples/example-validation.js @@ -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}`) }) diff --git a/examples/example.js b/examples/example.js index 346b05c6..dd8fa5d1 100644 --- a/examples/example.js +++ b/examples/example.js @@ -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}`) })