Skip to content

Commit

Permalink
Update example server.js
Browse files Browse the repository at this point in the history
Koa server example doesn't work with current version of koa and koa-router.
  • Loading branch information
shidianxia authored Nov 18, 2016
1 parent b679643 commit b16d37d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var amazon = require('../'),
router = require('koa-router');

var app = koa();
app.use(router(app));
var api = router();


var client = amazon.createClient({
Expand All @@ -21,4 +21,8 @@ app.get('/amazon/:index', function* () {
});
});

app.listen(3000);
app
.use(api.routes())
.use(api.allowedMethods());

app.listen(3000);

0 comments on commit b16d37d

Please sign in to comment.