Answers for "express url paramter /user/:id"

0

express js url with id

app.get('/:id', function(req, res) {
    res.send('id: ' + req.params.id);
});
Posted by: Guest on December-28-2021
4

express param in url

app.get('/p/:tagId', function(req, res) {
  res.send("tagId is set to " + req.params.tagId);
});

// GET /p/5
// tagId is set to 5
Posted by: Guest on October-14-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language