Hi, Don. On page 89 you say "Express.js provides middleware functionality ..." so you could do this kind of thing:
app.get("/foobar", middleware, function(res, req) {...});
I understand the concept, and I see that it does work as you describe. But I couldn't find this optional middleware parameter documented anywhere in Express' (or even Connect's) API reference. I looked here:
Going by just the API for express().get(), I would not have guessed that you could provide a middleware function as an optional second parameter. How did you figure this out, if there's no mention of it in express().get()'s API? Can you provide more than 1 middleware, like so:
app.get("/foobar", middleware1, middleware2, ..., function(res, req) {...});
Please send link to the API that describes this optional middleware parameter for express().get().
Thanks.


Reply With Quote

Bookmarks