0
有谁知道如何实现connect/express中使用的函数链。因此,人们可以做到这一点..NodeJS Connect/Express app.use处理
var app = {}, app.stack = [];
app.use(function(r, s, n){
// dosomething
})
require('http').createServer(function(r, s){
// execute functions in app stack
})
您想重新创建Connect/Express的中间件堆栈吗?如果是这样:为什么? – robertklep
教育。那func链似乎是一个有用的模式.. –
那么,一个好的起点是['connect/lib/proto.js'](https://github.com/senchalabs/connect/blob/master/lib/proto。 js),其中'use'和'handle'被实现。 – robertklep