redirect router express code example
Example 1: express redirect to url
app.get('/', (req, res) => {
res.redirect('/about');
})
Example 2: express redirect
res.redirect('/foo/bar')
res.redirect('http://example.com')
res.redirect(301, 'http://example.com')
res.redirect('../login')