-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,061
  • 6
  • 40
  • 65

1 Answers1

0

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,295
  • 12
  • 20