diff --git a/src/app.js b/src/app.js index c39087f..5198a0a 100644 --- a/src/app.js +++ b/src/app.js @@ -35,3 +35,11 @@ app.listen(3400, () => { console.log("Server listening on http://localhost:3400"); }); +// Global error handlers for uncaught exceptions and rejections +process.on("uncaughtException", (err) => { + console.error("Uncaught Exception:", err); +}); + +process.on("unhandledRejection", (reason) => { + console.error("Unhandled Rejection:", reason); +}); diff --git a/src/routes/index.js b/src/routes/index.js index d8d076c..f605b8c 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -9,7 +9,7 @@ const getBaseContext = require("../utils/baseContext"); -router.use("/contact", contact); +router.use(contact); router.get("/post/:year/:month/:name", async (req, res, next) => { const { year, month, name } = req.params;