redirect to a url 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');
});
Example 3: express js redirect to url
var express = require('express')
var app = express()
// respond with "hello world" when a GET request is made to the homepage
app.get('/', function (req, res) {
res.send('hello world')
})