0
response.redirect('route')
은 해당 경로의 모든 미들웨어를 다시 실행합니까?response.redirect ('route')는 해당 경로에 대한 모든 미들웨어를 다시 익스프레스로 실행합니다.
클라이언트와 같은 response.redirect('route')
가 서버에 새 요청을하는가요?
response.redirect('route')
은 해당 경로의 모든 미들웨어를 다시 실행합니까?response.redirect ('route')는 해당 경로에 대한 모든 미들웨어를 다시 익스프레스로 실행합니다.
클라이언트와 같은 response.redirect('route')
가 서버에 새 요청을하는가요?
예.
실제로 리디렉션이 발생하면 302 found
응답 후에 클라이언트가 리디렉션 된 URL에 요청을합니다.
예 :
app.use('/some/route', (req, res, next) => {
console.log('some middleware')
next()
})
app.get('/some/route', (req, res) => {
res.end()
})
app.get('/', (req, res) => {
res.redirect('/some/route')
})
시험 :
$ curl -L yourdomain.com/ // -> some middleware