From ce286fef1a4ac8f411934bb5cf6192894398e1a8 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Sat, 14 Jan 2023 04:05:00 -0500 Subject: [PATCH] fix local index.html not loading on / --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4507ce5..cc36b6a 100644 --- a/index.js +++ b/index.js @@ -55,7 +55,7 @@ if (config.hostDevFiles) { app.get('*', (req, res, next) => { let file = path.join(dir, req.path); - if (fs.existsSync(file)) { + if (fs.existsSync(file) && !file.endsWith('/') && !file.endsWith('\\')) { res.sendFile(file); } else { res.sendFile(path.join(dir, 'index.html'));