1app.get('/hello/:firstname/:lastname', (req, res) => {
2 console.log(req.params);
3 res.send('hello ' + req.params.firstname + ' ' + req.params.lastname);
4});
1app.get('/fruit/:fruitName/:fruitColor', function(req, res) {
2 var data = {
3 "fruit": {
4 "apple": req.params.fruitName,
5 "color": req.params.fruitColor
6 }
7 };
8
9 send.json(data);
10});
11