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.
На этой странице сайта вы можете посмотреть видео онлайн Express.js Fundamentals - 6 - Middleware Explained длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь JsWiz 26 Декабрь 2015, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 51,652 раз и оно понравилось 728 зрителям. Приятного просмотра!