0
Galley,
How do I change this line of my code:
app.use(express.static(__dirname + '/public'));
For 1 external redirect, for example redirect to
http://www.google.com
0
Galley,
How do I change this line of my code:
app.use(express.static(__dirname + '/public'));
For 1 external redirect, for example redirect to
http://www.google.com
Browser other questions tagged node.js http express
You are not signed in. Login or sign up in order to post.
Will be
res.redirect('http://www.google.com');
? Inside the hustle you want me to redirect– Miguel
Why do you want to tell the browser to ignore static files and use an external url? If you explain what you want to do I think you’ll get better help.
– Sergio
@Miguel this res in which place? when starting http?
– Marlon Maxwel
Right-hand side of a route, see: http://stackoverflow.com/questions/28352871/in-express-how-do-i-redirect-a-user-to-external-url or http://stackoverflow.com/questions/6757061/route-client-to-external-site-in-node-js
– Miguel
@Sergio I will not use the static part of my app, I passed it to another domain and I will be just consuming the services, because I need to do several things friendly URL and etc.
– Marlon Maxwel
@Miguel understood, then this line in my server.js that treats Static would cease to exist, correct?
– Marlon Maxwel
I think this line can continue, just redirect wherever you want... on the route you want
– Miguel
Wouldn’t it be a case of using the
<base>
? If you are not going to the server to return a redirect and it is more time consuming.– Sergio