I'm creating a desktop application using Node.JS that talks to SQL Server 
for MAC users .

Is it possible in Node.JS to take the input from the user and display the 
data from SQL server based on user input?

For example, in the code below, can I put an input box onload and allow 
user to input customercodeand display InvoiceNumber and customername.

Also, will I be able to run the below code on MAC?

var http = require('http');var edge = require('edge');var port = 
process.env.PORT || 8080;
var getTopUsers = edge.func('sql', function () {
   /* SELECT TOP 5 * FROM InvoiceHeader ORDER BY InvNumber DESC */});
function logError(err, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write("Error: " + err);
res.end("");
   }    

http.createServer(function (req, res) {
  res.writeHead(200, { 'Content-Type': 'text/html' });

  getTopUsers(null, function (error, result) {
      if (error) { logError(error, res); return; }
      if (result) {
          res.write("<ul>");
          result.forEach(function(user) {
              res.write("<li>" + user.InvNumber + " " + user.CompanyCode + ": " 
+ user.CompanyName + "</li>");
          });
          res.end("</ul>");
      }
      else {
      }
  });}).listen(port);
console.log("Node server listening on port " + port);

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/d29899c4-d2c5-478c-9398-8996fd683814%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to