Skip to content

Commit

Permalink
chore: troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-chris committed Feb 27, 2024
1 parent c008123 commit 653f417
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frontend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 653f417

Please sign in to comment.