I have started to explore node.js and I am wondering where user data would get stored if I wanted to create a registration form/login and logout functionality to the website.
I know that with php the form data is written and stored to the SQL database that is on my server.
What happens when I start to use node.js authentification packages. Do I still need to set up a SQL database on my server? Or does it work in a different way? Where would all the usernames, passwords and reg e-mails be stored?
Rather confused but so eager to learn node.js and make a simple working registration form.
Thanks guys!
Form data isn't necessarily stored (not unless you've handled it to be stored).
When you submit a form, you're basically creating a HTTP request, and from a HTTP request, the server can be designed to handle the data that was send from said HTTP request...
So, lets say you made a form like this:
Through some magic in your browser, when you click submit, this creates a HTTP request where-ever that
action
parameter is pointing to.So, we can then handle this data server-side in our NodeJS:
(Lets say we've already made a method to serve the form at
// ...
):