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?
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();