Middleware

Jun's Coding Journey·2022년 10월 30일
0

[Challenge] Youtube Clone

목록 보기
5/19

Middleware

A middleware is a function which has access to the request and response objects (req, res) along with the next object. The next middleware function is able to make changes, end, and call the next middleware function using the request and response objects.

Simply put, a middleware is like a security guard that checks whether the user can have access to a particular server or not.

External Middleware - Morgan

Morgan is a Node.js and Express middleware to log HTTP request and errors, and simplifies the whole process.

Morgan is similar to regular middlewares in terms of functionality. The one difference is that Morgan shows more detail when the server is running (ex. the time it took for the server to run).

profile
Greatness From Small Beginnings

0개의 댓글