14
Fri Oct 28 2022 08:46:22 GMT+0000 (Coordinated Universal Time)
Saved by
@Vrushabh_123
app.get('/products', async (req, res) => {
try {
const products = await Product.find({})
res.json({ success: true, products })
} catch (err) {
res.status(500).json({
success: false,
message: 'unable to get products',
errorMessage: err.message,
})
}
})
content_copyCOPY
Comments