-1

I have this app allocated in server 8088 and another server http://127.0.0.1:7777/

app.get('/', function(req, res) {
   res.redirect(' '); 
});

How can I make it that the page http://127.0.0.1:7777/ redirects to the page http://127.0.0.1:7777/2 (from server 8088 command)

try-catch-finally
  • 7,436
  • 6
  • 46
  • 67

1 Answers1

1

res.redirect('http://127.0.0.1:7777/2');

You can type in any URL to redirect to. https://expressjs.com/en/api.html#res.redirect

therobinkim
  • 2,500
  • 14
  • 20