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, () => {
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!");
});