Connect is an extensible HTTP server framework for node using “plugins” known as middleware.
这是引自Connect官方仓库的一段文字,可以看到:Connect是一个服务器端框架。在Connnect中,中间件是一个函数,它拦截HTTP
服务器提供的请求和响应对象,执行特定的逻辑,然后结束响应或者把她传递给下一个中间件组件。
Express也是一个Web框架,官方是这样介绍的:
Fast, unopinionated, minimalist web framework for Node.js.
前期版本中,Express框架是构建在Connect之上,但是在最新的4.x
版本中,我们引述了下面这段话:
Express 4 no longer depends on Connect, and removes all built-in middleware from its core, except for the express.static function. This means that Express is now an independent routing and middleware web framework, and Express versioning and releases are not affected by middleware updates.
但是,对Connect的介绍仍对我们理解Express很有帮助。