I have a Node/Express app that looks like this:
app.use(foo)
...
app.get('/foo/bar', ...)
...
app.get('/index', ...)
And I want to extract the middleware and the routes so that now I can do:
app.use(myMiddlewareAndRoutes)
...
app.get('/index', ...)
So that myMiddlewareAndRoutes adds the middleware foo and the route '/foo/bar' that belongs to it.