From b9699bd51255eae49e89dfcce7143c79c1e2bd56 Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Mon, 21 Jul 2025 20:56:11 +0200 Subject: [PATCH] fix: update import path for App component in main.tsx feat: add error handling middleware in server.js --- backend/server.js | 7 +++++++ client/src/main.tsx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/server.js b/backend/server.js index 63dae8e..3c22743 100644 --- a/backend/server.js +++ b/backend/server.js @@ -40,3 +40,10 @@ app.post("/api/login", async (req, res) => { app.listen(port, () => { console.log(`Express backend server is running at http://localhost:${port}`); }); + +// error handling code +app.use((err, req, res, next) => { + // Log the error stack and send a generic error response + console.error(err.stack); + res.status(500).send("Something broke!"); +}); \ No newline at end of file diff --git a/client/src/main.tsx b/client/src/main.tsx index 12eb902..5b3f104 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,7 +1,7 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import "./index.css"; -import App from "../other/App.tsx"; +import App from "../src/App.tsx"; createRoot(document.getElementById("root")!).render(