I need a specific o/p if i get empty params. But i was getting a "Cannot Get ... " .
- This is what i was doing:
app.get("/api/timestamp/:date", function(req, res)
{
let dateString = req.params.date;
...(some code here)
// empty params
if(!req.params.date) {
res.json({...});
};});
- This seems to solve the issue"
app.get("/api/timestamp/", function(req, res) {
res.json({...});
});
I dont understand why 1 didnt work.