Koa - A successor for Express
Refs
Why Koa ?
Smaller, more expressive, more robust.
VS Epxress
The key difference between Koa and Express is how they handle middleware. Express includes routing and templates in the application framework. Koa, on the other hand, requires modules for these features, therefore making it more modular or customizable.Koa application
A Koa application is an object containing an array of middleware functions which are composed and executed in a stack-like manner upon request.Cascading
Use Koa
Hello world
1 | const Koa = require('koa'); |
Middlewares
Middlewares can use aysnc/await
to control execution flow.
1 | const Koa = require('koa'); |
One Application for both HTTP and https
1 | const http = require('http'); |
Koa - A successor for Express
https://blog-cdt1.vercel.app/2022/07/22/Koa-A-successor-for-Express/