express redirect with data code example
Example 1: express redirect to url
app.get('/', (req, res) => {
res.redirect('/about');
})
Example 2: express redirect with post data
app.post('/', function(req, res) {
res.redirect(307, '/test');
});
app.get('/', (req, res) => {
res.redirect('/about');
})
app.post('/', function(req, res) {
res.redirect(307, '/test');
});