Very New to Node.js...
I am working on reading a barcode from a COM Port of a R232 Barcode Scanner.
I have found a Node.js call serialport and installed it. I can successfully read the barcode scan, from within a node.js command window, using the example from the installation.
My next step is to see if I can integrate this barcode scan within my ASP.net Web Forms application. I am hosting my application in IIS not looking to change that. Also trying to avoid using ActieX or Java Applets or Silverlight. Also trying to keep it browser based vs native Windows Desktop Application. At the moment don't have the time to convert to Asp.Net MVC.
This is now where I am confused.
1) Node.js can create its own web server and serve its own html content without the need of IIS. So that leads me to believe these two technologies cannot co-exist within the same project/web server instance. Is this true?
2) What I want to do is in the javascript of my Web Forms Application, make the call to read the serial port and populate an input textbox with the results. I don't want to start piecing this together if this is not possible, and I don't think it is. Looking for verification on my hypothesis.
e.g.
<!-- HTML FORM -->
<input type="textbox" id="txtBarcode" />
<!-- Javascript Section -->
<!-- Bind some event for the input textbox -->
<script>
function ReadScan(){
var com = require("serialport");
var serialPort = new com.SerialPort("COM4", {
baudrate: 9600,
parser: com.parsers.readline('\r\n')
});
serialPort.on('open',function() {
console.log('Port open');
});
serialPort.on('data', function(data) {
//I don't think will work here....
$('#txtBarcode').val(data);
});
}
</script>
3) I think what I am trying to do is treat node.js as just another web Javascript library like knockout.js or jQuery. Can I treat Node.js this way or no?