title: Calling stored procedure from node js
body: <p>I am using express and I am trying to call LoginMember stored procedure from Azure portal. This is my form from, taken from ejs:</p>
  
  <pre><code>&lt;form method="post" action="/available-copies"&gt;
        &lt;input type="text" placeholder="SSN" name="userssn"&gt;
        &lt;input type="password" placeholder="Password" name="userpassword"&gt;
        &lt;input type="submit" value="Login"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is my post request</p>
  
  <pre><code>router.post('/available-copies', function (req, res) {
      var ssn = req.body.userssn;
      var password = req.body.userpassword;
  
      sql.connect(sqlConfig, function (err) {
          if (err) console.log(err);
          // create Request object
          var request = new sql.Request();
          // query to the database and execute procedure
          request.query("exec LoginMember @SSN='"+ssn+"', @PASSWORD='"+password+"';", function (err, recordset) {
              if (err) console.log(err);
  
              res.send(recordset);
          });
      });
      sql.close()
  });
  </code></pre>
  
  <p>SqlConfig comes from another file and this part is fine. Just in case, this is my stored procedure creation code:</p>
  
  <pre><code>CREATE PROCEDURE LoginMember @SSN varchar(11), @PASSWORD char(64)
  AS
  BEGIN
     Select * from Member
     WHERE Member.ssn = @SSN AND Member.password = @PASSWORD
  END
  </code></pre>
  
  <p>What happens- When I submit my form, page keeps loading for 3-5mins, after that I get </p>
  
  <pre><code>This page isn’t working
  localhost didn’t send any data.
  </code></pre>
  
  <p>Console doesn't return any additional errors. <strong>I know this might be not the best solution I can be using, but this is my approach and I want to make it work.</strong></p>