Routing refers to how an application’s endpoints (URIs) respond to client requests.
app.get('/', function (req, res) {
res.send('hello world')
})
Express - Middleware
#ege-academy-nodejs @rbung @yagong
Middleware functions are functions that have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle.
const myLogger = function (req, res, next) {
console.log('LOGGED')
next()
}
// ... some code
app.use(myLogger)