concept Connect in category javascript

This is an excerpt from Manning's book Single Page Web Applications: JavaScript end-to-end.
Connect is an extensible middleware framework that adds capabilities like basic authentication, session management, static file serving, and form handling to a Node.js web server. It’s not the only framework available, but it’s simple and relatively standard. Connect allows us to inject middleware functions between the receipt of a request and the final response. Generally, a middleware function takes an incoming request, performs some actions on it, and then hands the request to the next middleware function or ends the response using the response.end method.
The best way to become familiar with Connect and the middleware pattern is to use it. Let’s ensure webapp is our working directory, and install connect. Type the following at the command line:
Listing 7.5. Modify the node server application to use Connect—webapp/app.js
/* * app.js - Simple connect server */ ... var connectHello, server, http = require( 'http' ), connect = require( 'connect' ), app = connect(), bodyText = 'Hello Connect'; connectHello = function ( request, response, next ) { response.setHeader( 'content-length', bodyText.length ); response.end( bodyText ); }; app.use( connectHello ); server = http.createServer( app ); server.listen( 3000 ); console.log( 'Listening on port %d', server.address().port );