Skip to content

Commit

Permalink
Fix example typos. Closes #216.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmingoia committed Jan 19, 2016
1 parent eec15be commit 17fd098
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ Nesting routers is supported:
var forums = new Router();
var posts = new Router();

posts.get('/', function *(ctx, next) {...});
posts.get('/:pid', function *(ctx, next) {...});
posts.get('/', function (ctx, next) {...});
posts.get('/:pid', function (ctx, next) {...});
forums.use('/forums/:fid/posts', posts.routes(), posts.allowedMethods());

// responds to "/forums/123/posts" and "/forums/123/posts/123"
Expand Down
2 changes: 1 addition & 1 deletion lib/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Layer.prototype.url = function (params) {
*
* ```javascript
* router
* .param('user', function *(id, ctx, next) {
* .param('user', function (id, ctx, next) {
* ctx.user = users[id];
* if (!user) return ctx.status = 404;
* next();
Expand Down
4 changes: 2 additions & 2 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function Router(opts) {
* var forums = new Router();
* var posts = new Router();
*
* posts.get('/', function *(ctx, next) {...});
* posts.get('/:pid', function *(ctx, next) {...});
* posts.get('/', function (ctx, next) {...});
* posts.get('/:pid', function (ctx, next) {...});
* forums.use('/forums/:fid/posts', posts.routes(), posts.allowedMethods());
*
* // responds to "/forums/123/posts" and "/forums/123/posts/123"
Expand Down

0 comments on commit 17fd098

Please sign in to comment.