fix: update import path for App component in main.tsx
feat: add error handling middleware in server.js
This commit is contained in:
@@ -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!");
|
||||||
|
});
|
@@ -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>
|
||||||
|
Reference in New Issue
Block a user