I'm a front-end developer learning Express and Node and am working on a small application where I want to ask the user for the name of a directory I will create for them. Up until now my Express app has consisted of routes and server-side rendering of Pug templates. When I need information from the user I do it through a form which I then process in an app.post method. Thus, except for processing forms, it's pretty static, e.g. various pages are sent to the user without much going on inside the page.I'm trying to figure out what the best way to handle more complicated interactions within a server-side rendered page. For instance, getting the name of the directory from the user. I'm not sure if there is a "Express" way of thinking on this. If I were working on the front end I'd just pop up a modal dialog (e.g. some kind of prompt). Is that the way to do it even if I'm working from the back-end, or should I instead go to a new route to get the info, where I'd display a form and then on submitting that form back to my original route with that new information?Thanks for any clues or direction…
Submitted August 12, 2018 at 12:18PM by atacamasand
No comments:
Post a Comment