08 - Chain Middleware to Create a Time Server - Basic Node and Express - freeCodeCamp Tutorial

preview_player
Показать описание
Don't be an overconfident idiot like me, and you should be fine here!
We can avoid setting up multiple routes, and instead chain the middleware functions one after the other. When declaring a route, you can give as many arguments as you can, consisting of functions to be executed in order.

Concepts:
Middleware
Middleware functions are functions that have access to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle. The next middleware function is commonly denoted by a variable named next.

Mounts the specified middleware function or functions at the specified path: the middleware function is executed when the base of the requested path matches path.

-————————————————————————————————————-

freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.

Thanks for Watching!
Рекомендации по теме
Комментарии
Автор

your videos are like going inside a taxi and without telling the driver where you want to go, he just brings you there, nice vide.

unamicadetot
Автор

Great Video Ganesh! But my 2nd test does not pass at all. I get the error: "The /now endpoint should return the current time." Neither Replit works nor a Heroku deploy from my local machine.

webtutorials
Автор

I had the same code for this challenge. But I do not pass the second test - "The /now endpoint should return a time that is +/- 20 secs from now".
What might be the issue?

yellowbook