From 6d334822c6b18e272c2a66f397579f045762b31d Mon Sep 17 00:00:00 2001 From: Vin Brun Date: Sun, 12 Jan 2025 18:19:18 -0300 Subject: [PATCH] simplify server startup, as was on the original example --- examples/search/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/search/index.js b/examples/search/index.js index db533eab46..ee11747637 100644 --- a/examples/search/index.js +++ b/examples/search/index.js @@ -29,7 +29,7 @@ app.use(express.static(path.join(__dirname, 'public'))); async function initializeRedis() { try { // connect to Redis - + await db.connect(); // populate search @@ -77,8 +77,7 @@ app.get('/client.js', function(req, res){ (async () => { await initializeRedis(); if (!module.parent) { - app.listen(3000, () => { - console.log('Express started on port 3000'); - }); + app.listen(3000); + console.log('Express started on port 3000'); } })(); \ No newline at end of file