728x90
반응형
app.use([path,] callback [, callback...])
1. 패스가 지정되어 있지 않기 때문에 모든 경로에서 계속 호출
app.use(function (req, res, next) {
console.log('Time: %d', Date.now())
next()
})
2. '/abcd' 경로에 들어왔을 때만 실행
app.use('/abcd', function (req, res, next) {
console.log('Time: %d', Date.now())
next()
});
728x90
반응형
'JavaScript > NodeJs' 카테고리의 다른 글
[Prisma2] ON DELETE CASCADE는 어떻게 하는건가! (0) | 2020.09.03 |
---|---|
[GraphQL] Over-fetching과 Under-fetching? (0) | 2020.08.27 |