Express app.use
When you call app.use()
, you pass in a function to handle requests. As requests come in, Express goes through all of the functions in order until the request is handled.
express.favicon
is a simple function that returns favicon.ico when it is requested. It's actually a great example for how to get started with this pattern. You can view the source code by looking at its source: node_modules/express/node_modules/connect/lib/middleware/favicon.js
express.cookieSession
is some more middleware for supporting session data, keyed from the client by a cookie.
I don't know what count
does... is that your own code? In any case, let me know if this is not clear.