Express.js Fundamentals - 6 - Middleware Explained

Publié le: 26 décembre 2015
sur la chaîne: JsWiz
51,652
728

Projects in Node.js: https://goo.gl/rT7o2k

In this video we'll go more into detail what Middleware means and provide some examples.

We can define middleware as any number of functions that are invoked by the Express.js routing layer before your final request handler is made.

So essentially we're saying, on our defined route Do Something first, then pass it along to the next function. Each time we will use the request/response objects of an HTTP cycle to Alter, End or pass to Next whatever it is we're handling.

In this example before sending someone to the route they request we would deal any CORS or CSRF issues that may arise, we'd check to see if the user was authorized and if all is good, then we would send them to where they want to go.


Sur cette page du site, vous pouvez voir la vidéo en ligne Express.js Fundamentals - 6 - Middleware Explained durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur JsWiz 26 décembre 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 51,652 fois et il a aimé 728 téléspectateurs. Bon visionnage!