From 4e0ad22dc7305586565cf00cefbee7edb47aef12 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 5 Aug 2022 11:43:00 +0100 Subject: [PATCH] chore: replace use of deprecated variadic `listen()` --- README.md | 2 +- benchmarks/fastify.js | 2 +- examples/example.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 564d69e..e082a7b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ fastify.register( { contentSecurityPolicy: false } ) -fastify.listen(3000, err => { +fastify.listen({ port: 3000 }, err => { if (err) throw err }) ``` diff --git a/benchmarks/fastify.js b/benchmarks/fastify.js index fdd34f6..aa5dc18 100644 --- a/benchmarks/fastify.js +++ b/benchmarks/fastify.js @@ -28,6 +28,6 @@ app.get('/', opts, function (request, reply) { reply.send({ hello: 'world' }) }) -app.listen(3000, err => { +app.listen({ port: 3000 }, err => { if (err) throw err }) diff --git a/examples/example.js b/examples/example.js index e309325..ab979e7 100644 --- a/examples/example.js +++ b/examples/example.js @@ -40,7 +40,7 @@ fastify.get('/route-with-disabled-helmet', { ...opts, helmet: false }, function .send({ hello: 'world' }) }) -fastify.listen(3000, err => { +fastify.listen({ port: 3000 }, err => { if (err) throw err fastify.log.info(`Server listening on ${fastify.server.address().address}:${fastify.server.address().port}`) })