2
JordMan
7y

Any good tutorials to build a simple users system with node.js and MySQL db? I just started node.js and I can't find anything good....

Comments
  • 0
    That's cause you are better of with mongodb. 😋

    Jokes aside:
    https://w3schools.com/nodejs/...
  • 0
    @rootshell but this only teach me how to use SQL in the node.js, which I basically know... I'm trying to understand how to build users system, everything I found online was crappy...
    Is it the same like creating users system in php?
  • 0
    @JordMan Most back end api calls follow the same principle

    If success return status code

    Else

    Return status code etc etc

    More or less the same for any language
  • 0
    @rootshell @forE ok, I tried to do something but there's a few things I don't understand... How to know that form was submitted? How to make it run several web pages?
  • 0
    @JordMan So form submitted: You pass the route as a parameter form the form, with a post request

    The route should reflect this:

    Router.post(‘url route goes here etc’)

    Inside the route you validate the form before submitting it, input fields etc

    If the form submission was successful your return a status code;

    Using a REST client like POSTMAN or insomnia you can submit the data in the form of JSON to the route and if works the success status code will be returned if it wasn’t you’ll get a different one
  • 0
    @JordMan if you’ve got the code on github I’ll have a gander for you when I’ve got some free time, however I would try to keep questions like this on SO or the discord channel I guess
Add Comment