Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

express js params

app.get('/path/:name', function(req, res) { // url: /path/test
  console.log(req.params.name);  // result: test
});

// OR

app.get('/path', function(req, res) {  // url: /path?name='test'
  console.log(req.query['name']);  // result: test
});
 
PREVIOUS NEXT
Tagged: #express #js #params
ADD COMMENT
Topic
Name
6+2 =