4. Sidenote: Modules
There are a ton of modules out there, but not all of them get updated in
a timely manner.
When dependencies break your app it can be painful to fix.
14. What's up with app.use()?
It registers middleware in your Express application. Middleware is
additional functionality injected into request handling.
There is an order to middleware. If one piece of middleware services a
request, the request is considered handled and the rest of the
middleware is not used.
15. For example we can register the 'express.static' middleware to serve up
static files for requests.
app.use(express.static(path.join(__dirname,'public')));
16. Or we can define our own:
app.use(function(req,res,next){
if(!req.get('authorization')){
res.Send(403,"NotAllowedSon,BetterLuckNextTime");
}else{
next();
}
});