我面临一个非常具体的用例,在迭代应用程序对象时,我需要访问各种快速子应用程序的挂载路径。
示例代码:
const express = require("express")
const app = express()
app.use("/users", new usersRouter())
app.use("/flowers", new flowersRouter())
// Later in code...
app.get("/something", (req, res, next) => checkAppObject(app, next))
function checkAppObject(app, next) {
// Where are stored the "/users" and "/flowers" info ?
console.log(app)
next()
}
我在任何地方都没有找到