1
Hello, my question is this::
I am using Express/bodyParser and Nunjucks. I submitted a form with the method POST
from my root route '/'.
In the form I have two dice:
- Username
- Date of birth
In the post I submit the form I can do a check, for example, what the age of the user. If he’s older, I redirect him to route X if he’s underage I redirect him to Y.
My doubt is precisely on this route X and Y. How do I bring the name that the user submitted in this request for a new route?
I’m using redirect to send it to X or Y.
Daniel, I tried to do as you said it returns "name is not defined" when it redirects. I thought I could pass as I step variables to the view: res.redirect('/major', { name: name}); but it is not possible.
– Bruno