Node JS Express MongoDB Temukan semua dokumen
//to get all the products
app.get("/products", async (req, res) => {
try {
const allProducts = await Product.find();
return res.json(allProducts);
} catch (error) {
res.json({ message: error });
}
});
Philan ISithembiso