Hi! I wanted to make my small API server on NODE.js, but I ran into the problem that the server does not see the id variable from the query string and I constantly get code from else{...} .
router.get('/:id',(req,res,next)=>{ const id = req.param.id; if (id === 'special') { res.status(200).json({ message: 'You discover the special Id', id : id }); }else{ res.status(200).json({ message: '', id: id }); } } ); Can you tell me how to fix this?
{message : ''}. - Oleksandr Tatarinov