From a5e08af45684051c18287f00b7780b3f9e55e0b9 Mon Sep 17 00:00:00 2001 From: Toh Jing Hua Date: Mon, 17 Apr 2023 00:34:56 +0800 Subject: [PATCH] fix: electron file path --- electron/index.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/electron/index.cjs b/electron/index.cjs index 26d8454..dede82a 100644 --- a/electron/index.cjs +++ b/electron/index.cjs @@ -106,7 +106,9 @@ const createServer = () => { const server = http.createServer((request, response) => { // Get the file path from the URL let filePath = - request.url === '/' ? '../dist/index.html' : `../dist/${request.url}`; + request.url === '/' + ? `${path.join(__dirname, '../dist/index.html')}` + : `${path.join(__dirname, `../dist/${request.url}`)}`; // Get the file extension from the filePath let extname = path.extname(filePath);