Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Where should I assign res.redirect #13

Open
otogen opened this issue Mar 18, 2013 · 0 comments
Open

Where should I assign res.redirect #13

otogen opened this issue Mar 18, 2013 · 0 comments

Comments

@otogen
Copy link

otogen commented Mar 18, 2013

Hi, I am a super beginner about Node.js and Express

facebook-template-nodejs example works fine, then I would like to add res.redirect('/AnotherPage') when pushed a button. But I can not get solution. Because your code:

app.get('/',handle_facebook_request);
app.post('/',handle_facebook_request);

I wonder if I should write like as:

function handle_facebook_request(req,res){

if(req.param('button')){
res.redirect('/AnotherPage');
}
....
});

But I think it is wrong. Where should I assign res.redirect?

In case of pushed button, I always write as:

app.post('/', function(req,res){
if(req.param('button')){
res.redirect('/AnotherPage');
}
});

But I am not sure about your example case.

Thank you for your thoughts !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant