1app.get('/path/:name', function(req, res) {
2 res.send("tagId is set to " + req.params.name);
3});
1app.get('/p/:tagId', function(req, res) {
2 res.send("tagId is set to " + req.params.tagId);
3});
4
5// GET /p/5
6// tagId is set to 5
7
1// http://localhost:8080/api/1
2app.get('/api/:version', function(req, res) {
3 res.send(req.params.version);
4});
1URL Parameters
2These are information that are passed through the URL like so:
3
4http://example.com/api/users?id=4&token=sdfa3&geo=us