From the course: Learning Koa

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Example of cascading

Example of cascading

From the course: Learning Koa

Start my 1-month free trial

Example of cascading

- [Instructor] We'll get started with a full example of cascading in this video, and finish it in the next so if you do any test in your server in this video, be aware that the code will be incomplete. So some of it will work, some of It will not work so wait until the very next video until you test it. So let's get started on adding the proper code. So the first thing I'm going to do is remove the app.context.date here. We're not going to use it, we're actually going to create a date inside of a logger. So let's remove that first, and then what we'll do is refactor our response. So right now we're doing a try and catch, we're not going to use that anymore so we're just going to do a response and the way I want you to refactor this one is remove all this here, like so, and then the code from 13 to 15 like so. So you should only see ctx.response.body, and let's also remove the await, and then ctx.userdata. So that's only what you should see. The next thing we're going to do is add a…

Contents