fix: update import path for App component in main.tsx

feat: add error handling middleware in server.js
This commit is contained in:
2025-07-21 20:56:11 +02:00
parent 7ab62b8d13
commit b9699bd512
2 changed files with 8 additions and 1 deletions

View File

@@ -40,3 +40,10 @@ app.post("/api/login", async (req, res) => {
app.listen(port, () => { app.listen(port, () => {
console.log(`Express backend server is running at http://localhost:${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!");
});

View File

@@ -1,7 +1,7 @@
import { StrictMode } from "react"; import { StrictMode } from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import "./index.css"; import "./index.css";
import App from "../other/App.tsx"; import App from "../src/App.tsx";
createRoot(document.getElementById("root")!).render( createRoot(document.getElementById("root")!).render(
<StrictMode> <StrictMode>