examples: add full urls to web-service example

closes #3519
This commit is contained in:
Steven Anthony 2017-12-28 23:29:38 -05:00 committed by Douglas Christopher Wilson
parent 98b0b66b6c
commit 80e64691e1

View File

@ -69,14 +69,17 @@ var userRepos = {
// we now can assume the api key is valid,
// and simply expose the data
// example: http://localhost:3000/api/users/?api-key=foo
app.get('/api/users', function(req, res, next){
res.send(users);
});
// example: http://localhost:3000/api/repos/?api-key=foo
app.get('/api/repos', function(req, res, next){
res.send(repos);
});
// example: http://localhost:3000/api/user/tobi/repos/?api-key=foo
app.get('/api/user/:name/repos', function(req, res, next){
var name = req.params.name;
var user = userRepos[name];