Answers for "express pass parameter"

28

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
});
Posted by: Guest on January-29-2021
0

Node.js passing parameters to client via express render

<h1>{{ name }}</h1>
Posted by: Guest on May-31-2021

Code answers related to "express pass parameter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language