摘要: application.js const http = require("http")// 洋葱模型 function compose(middleware){ return function(ctx,next){ let index = -1 return dispatch(0) function 阅读全文
posted @ 2021-02-02 15:18 Esther_Cheung 阅读(63) 评论(0) 推荐(0) 编辑
摘要: koa不愧为小而美,主要代码很少。简单来说,1,koa封装了node的http.createServer((req,res)=>{})的入参req,res到ctx同名属性(一个自定义对象)中,并且额外提供了ctx.request,ctx.request提供一些快捷的操作。 const app = n 阅读全文
posted @ 2021-02-02 11:57 Esther_Cheung 阅读(136) 评论(0) 推荐(0) 编辑