Homepg & ProductDet.. now updated

This commit is contained in:
Mann Patel
2025-03-25 14:47:54 -06:00
parent e7a6e1dd8b
commit f52693dfc2
4 changed files with 156 additions and 68 deletions

View File

@@ -1,16 +1,20 @@
// routes/product.js
const express = require("express");
const {
addToFavorite,
getAllProducts,
getProductById,
} = require("../controllers/product");
const router = express.Router();
// Add detailed logging middleware
router.use((req, res, next) => {
console.log(`Incoming ${req.method} request to ${req.path}`);
next();
});
router.post("/add_fav_product", addToFavorite);
router.get("/get_product", getAllProducts);
router.post("/get_productID", getProductById);
router.get("/:id", getProductById); // Simplified route
module.exports = router;