How to route get requests received in express according to parameters?

  node.js, question

Before submitting the form, perform two request response operations

The desired effect is as follows

app.all('/form',functuon(req,res,next){
 if(req.query.key1){
 res.redirect('/form/getkey1');
 bracket
 if(req.query.key2){
 res.redirect('/form/getkey2');
 bracket
 if(req.query.key3){
 res.redirect('/form/getkey3');
 bracket
 });

However, during the experiment, the first one can be redirected successfully, and the second one cannot be redirected. Please be advised by the Great God. Thank you very much.

It seems that res.redirect () can only be used once. You should request the server to return once, not many times.