7 回复
摘录express 4.0文档里的一段话
The “mount” path is stripped and is not visible to the middleware function. The main effect of this feature is that mounted middleware may operate without code changes regardless of its “prefix” pathname.
除了文字原本的意思之外,我的理解就是中间件不应该对上下文环境太敏感,一旦出现了几个中间件之间依赖的关系,那就应该检讨是否中间件的设计和抽象出问题了,或者就不该用中间件来解决