From a8c5ca2f36354a2117f5fb0797a9a11053b0f287 Mon Sep 17 00:00:00 2001 From: KartikeSingh Date: Mon, 24 Jun 2024 11:01:14 +0530 Subject: [PATCH] docs: fix conjunction with fastify example --- Readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 19c0aeddc7..cf120cd71a 100644 --- a/Readme.md +++ b/Readme.md @@ -160,7 +160,9 @@ called `io`. ```js const app = require('fastify')(); app.register(require('fastify-socket.io')); -app.io.on('connection', () => { /* … */ }); +app.ready().then(() => { + app.io.on('connection', () => { /* … */ }); +}) app.listen(3000); ```