diff --git a/frontend/index.js b/frontend/index.js index a1ec42c777..ae74652c82 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -10,15 +10,12 @@ Bun.serve({ console.log("Resolved file path:", filePath); try { - // Check if the requested file exists - await Bun.stat(filePath); - - // If the file exists, serve it + // Attempt to fetch the file const file = Bun.file(filePath); + // Return the file if it exists return new Response(file); } catch (error) { console.error("Error occurred while fetching file:", error); - // If the file doesn't exist, serve the index.html file const indexFilePath = BASE_PATH + "/index.html"; const indexFile = Bun.file(indexFilePath); @@ -27,7 +24,6 @@ Bun.serve({ }, error(error) { console.error("Server error:", error); - // Serve the index.html file in case of any server error const indexFilePath = BASE_PATH + "/index.html"; const indexFile = Bun.file(indexFilePath);