how to do redirect in nodejs express code example
Example 1: javascript redirect
window.location.href = "http://mywebsite.com/home.html";
Example 2: express redirect
app.get('/', (req, res) => {
res.redirect('/foo/bar');
});
window.location.href = "http://mywebsite.com/home.html";
app.get('/', (req, res) => {
res.redirect('/foo/bar');
});