-1

I want to redirect to x url(http://www.google.com for example) when the user hits a button. I already tried using open:

var open = require('open');
open('http://www.google.com');

But that opens a new window with the requested url, so the question would be:

How can I redirect to a url into the same browser window?

Pantera96c
  • 75
  • 1
  • 1
  • 9

1 Answers1

0

EDIT:

After what has been specified, I think the proper answer is something like this:

response.writeHead(302, {
  'Location': 'url-goes-here'
  //add other headers here...
});
response.end();

Source

Community
  • 1
  • 1
William Barbosa
  • 4,936
  • 2
  • 19
  • 37