Koa2 支持 async,所以选择之。
npm install koa@2
把1.0中间件转换成2.0的
json解析
$ npm install --save koa-bodyparser@next
Koa静态文件
Koa 路由
$ npm install --save koa-router@next
Koa middleware for serving a favicon.
$ npm install --save koa-favicon@next
压缩
$ npm install --save koa-compress@next
打印请求日志, 推荐
打印请求日志
$ npm install --save koa-logger@next
允许跨域访问
生成 package.json
$ npm init