¡Esta es una revisión vieja del documento!
$ npm init$ npm install express –savevar express = require('express');
var app = express();
app.listen(3000, function() {
console.log("server started on Port 3000");
})
Take the get to de home (using request and the response):
app.get('/', fucntion(req, res) {
res.send('Hello world');
});
use is important to put it before any request.
var logger = function (req, res, next){
console.log('Logging');
next();
}
app.use(logger);