You can define middlewares, as you would do server-side with expressjs:
router.route({ method: 'GET', path: '/users/:userId', handler: function (ctx) { // load user async getUser(ctx.params.userId, function (err, user) { ctx.user = user; ctx.next(); // exec next middleware }); } });
You can define middlewares, as you would do server-side with expressjs:
There is a `demo` folder with a detailed example. The main entry point for the client is here https://github.com/gcanti/tom/blob/master/demo/client.js#L21