Answers for "expressjs redirect to url"

50

express js redirect to url

window.location.href = "http://mywebsite.com/home.html";
Posted by: Guest on July-18-2019
1

express redirect to url

app.get('/', (req, res) => {
  res.redirect('/about');
})
Posted by: Guest on October-27-2020
2

express redirect to url

app.get("/where", (req, res) => {
   res.status(301).redirect("https://www.google.com")
}) //You need to include the status (301)
Posted by: Guest on October-19-2021
3

express redirect

app.get('/', (req, res) => {
  res.redirect('/foo/bar');
});
Posted by: Guest on July-18-2020
1

express redirect

res.redirect('https://google.com')
Posted by: Guest on March-17-2021
0

express js redirect to url

// GET method route
app.get('/', function (req, res) {
  res.send('GET request to the homepage')
})

// POST method route
app.post('/', function (req, res) {
  res.send('POST request to the homepage')
})
Posted by: Guest on July-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language