const express = require( 'express' );
const app = express();
// Our first middleware, logging out request.
app.get( '/', ( request, response, next ) => {
console.log( 'Got request', request );
next(); // Passing control to the next middleware.
} );
// Our second middleware, sending response to the user.
app.get( '/', ( request, response ) => {
response.send( 'Hello World!' );
} );
app.listen( 3000 );