Skip to content

Commit

Permalink
examples: add full urls to web-service example
Browse files Browse the repository at this point in the history
closes #3519
  • Loading branch information
stevenanthonyrevo authored and dougwilson committed Feb 13, 2018
1 parent 98b0b66 commit 80e6469
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/web-service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 80e6469

Please sign in to comment.