From 13a90c372a7f5a761e2aefc53bb2589abd068b58 Mon Sep 17 00:00:00 2001 From: bradbalogh Date: Tue, 6 Jun 2023 12:41:58 -0500 Subject: [PATCH] set root for default endpoint to prevent TypeError --- with-socket-io/backend/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/with-socket-io/backend/index.js b/with-socket-io/backend/index.js index f1e6ff4a..21a5ba9f 100644 --- a/with-socket-io/backend/index.js +++ b/with-socket-io/backend/index.js @@ -16,7 +16,7 @@ setInterval(() => { }, 1000); // Show the index.html by default -app.get('/', (req, res) => res.sendFile('index.html')); +app.get('/', (req, res) => res.sendFile('index.html', { root: '.' })); // Start the express server http.listen(3000, function(){