parent
00156dfec6
commit
df7b4ff2b8
1 changed files with 2 additions and 4 deletions
|
@ -3,8 +3,8 @@ THIS DOCUMENT IS IN PROGRESS. THIS PARAGRAPH SHALL BE REMOVED WHEN THIS DOCUMENT
|
||||||
# Koa vs Express
|
# Koa vs Express
|
||||||
|
|
||||||
Philosophically, Koa aims to "fix and replace node", whereas Express "augments node".
|
Philosophically, Koa aims to "fix and replace node", whereas Express "augments node".
|
||||||
Koa uses co to rid apps of callback hell and simplify error handling.
|
Koa uses promises and async functions to rid apps of callback hell and simplify error handling.
|
||||||
It exposes its own `this.request` and `this.response` objects instead of node's `req` and `res` objects.
|
It exposes its own `ctx.request` and `ctx.response` objects instead of node's `req` and `res` objects.
|
||||||
|
|
||||||
Express, on the other hand, augments node's `req` and `res` objects with additional properties and methods
|
Express, on the other hand, augments node's `req` and `res` objects with additional properties and methods
|
||||||
and includes many other "framework" features, such as routing and templating, which Koa does not.
|
and includes many other "framework" features, such as routing and templating, which Koa does not.
|
||||||
|
@ -57,8 +57,6 @@ THIS DOCUMENT IS IN PROGRESS. THIS PARAGRAPH SHALL BE REMOVED WHEN THIS DOCUMENT
|
||||||
|
|
||||||
### Generated-based control flow
|
### Generated-based control flow
|
||||||
|
|
||||||
Thanks to co.
|
|
||||||
|
|
||||||
No callback hell.
|
No callback hell.
|
||||||
|
|
||||||
Better error handling through try/catch.
|
Better error handling through try/catch.
|
||||||
|
|
Loading…
Reference in a new issue