Skip to content

Commit

Permalink
Update contactUsRouter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
PriyanshuValiya authored Oct 24, 2024
1 parent f6044b1 commit 3a8d7e3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/routes/contactUsRouter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
const express = require("express");
const router = express.Router();
const { createContactUs } = require("../controller/contact.controller");
const { validationResult } = require("express-validator");

router.post("/contactus", createContactUs);
// Error handling middleware
router.use((err, req, res, next) => {
console.error(err.stack);
res.status(500).json({
status: "error",
message: "An error occurred processing your request"
});
});

router.post("/contactus", createContactUs);

module.exports = router;

0 comments on commit 3a8d7e3

Please sign in to comment.