Koa is a Node.js web framework designed by the same team that brought you Express. The main goal of this framework is to be a smaller and more expressive foundation for web apps and APIs. If you have ever worked on Express and have gotten tired of callback hell when the app gets larger, Koa allows you to ditch the callbacks and greatly increase error handling by leveraging async functions. Another cool thing in Koa is cascading – the middleware you add will be running "downstream," and then flowing back "upstream," which gives you more predictable controls. We will demonstrate this later in this chapter.
If you want to find out more info about Koa, please visit https://koajs.com/.
Installing and configuring Koa
Now, let's create a Koa app with the Backpack default configuration (without creating the Backpack config file) as follows:
- Install Koa via npm:
$ npm i koa
- Use /src/ as the Backpack default entry directory and create an entry...