Skip to content

Commit b5f8741

Browse files
authored
Merge pull request #157 from fastify/Fdawgs-patch-1
docs(readme): replace use of deprecated variadic `listen()`
2 parents 3a0452f + 249c667 commit b5f8741

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fastify.post('/foo', (req, reply) => {
7373
})
7474
})
7575

76-
fastify.listen(3000, err => {
76+
fastify.listen({ port: 3000 }, err => {
7777
if (err) throw err
7878
console.log(`server listening on ${fastify.server.address().port}`)
7979
})
@@ -154,7 +154,7 @@ fastify.post('/world', (req, reply) => {
154154
})
155155
})
156156

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

207-
fastify.listen(3000, function (err) {
207+
fastify.listen({ port: 3000 }, function (err) {
208208
if (err) {
209209
fastify.log.error(err)
210210
process.exit(1)

0 commit comments

Comments
 (0)