diff --git a/examples/web-service/index.js b/examples/web-service/index.js index 5a603a10..0e2cbb7c 100644 --- a/examples/web-service/index.js +++ b/examples/web-service/index.js @@ -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];