docs: faq
This commit is contained in:
parent
0e4545c03b
commit
8a7554525b
1 changed files with 6 additions and 17 deletions
23
docs/faq.md
23
docs/faq.md
|
@ -3,25 +3,14 @@
|
|||
|
||||
## Does Koa replace Express?
|
||||
|
||||
No, it's more like Connect.
|
||||
It's more like Connect, but a lot of the Express goodies
|
||||
were moved to the middleware level in Koa to help form
|
||||
a stronger foundation. This makes middleware more enjoyable
|
||||
and less error-prone to write.
|
||||
|
||||
## Does Koa replace Connect?
|
||||
|
||||
No, just a different take on similar functionality
|
||||
now that generators allow us to write code with less
|
||||
callbacks. Connect is equally capable, and some may still prefer it.
|
||||
|
||||
## Why does Koa have functionality similar to Express?
|
||||
|
||||
Many of the Express request/response methods have been moved to Koa because
|
||||
they are more useful at the middleware level. If you make the edges smart,
|
||||
the intermediaries can do less and become more dumb, this reduces and conflicts
|
||||
when middleware constantly attempt to re-invent the same behaviours such as parsing
|
||||
signed cookies.
|
||||
|
||||
Additionally it makes writing middleware and applications more enjoyable, when the
|
||||
mundane every-day HTTP work is less in your face.
|
||||
|
||||
Finally certain behaviours such as signed cookie secret management, and upstream
|
||||
HTTPS proxy authorization benift greatly from app-level control. Configuring these
|
||||
for each end-point would be extremely annoying and error-prone.
|
||||
callbacks. Connect is equally capable, and some may still prefer it,
|
||||
it's up to what you prefer.
|
||||
|
|
Loading…
Reference in a new issue