title: node, sql and jquery -> Registration form - access data on server
body: <p>So I have a registration form. When I type the details and click on the submit button, that data is supposed to go directly into the mySQL database. So this is my index.html part where I do stuff when I click on the submit button.</p>
  
  <pre><code>            $("#reg button#submit").click(function () {
                  $.ajax({
                      type: "POST",
                      url: "http://127.0.0.1/reg",
                      data: {
                          username: $("#usr").val(),
                          password: $("#pwd").val()
                      },
                      success: function (res) {
                          //
                      }
  
                  });
              });
  </code></pre>
  
  <p>Now I save that data with ajax call, but how do I access it on the server.js?</p>
  
  <p>I suppose it is with app.get() but what to do next?</p>
  
  <pre><code>app.get('/reg', function (req, res) {
      /// get the username and password and do a query and send them to database. How?
  });
  </code></pre>