koa and exprsss difference

koa and exprsss difference

  1. koa no built-in middleware

  2. express There are several built-in middleware, such as express.static () // Load static resources

  3. koa no longer req, res request, which is encapsulated in the context ctx inside

  4. is req express request data, the respective content res

  5. koa own package routing rules

installation

Global Installation: koa-generator frame

npm install koa-generator -g

Create a new folder: myapp

cd myapp

koa -h: View koa frame content

npm -e myapp installation environment: automatically generate a folder

npm install: the installation file directory structure

 

 

Guess you like

Origin www.cnblogs.com/clover-liu/p/11600248.html