Reputation: 835
I want to experiment with NodeJS. My windows 7 machine already have IIS ruuning for intranet purpose. I simply want nodejs to run on own listening to a different port. Is there an side effect to this setup that I need to know about? All my search on the web seem to be about running nodejs from with iis. I am simply looking for running nodejs on own; hoping there is a way to set a different port number when I install it.
Thank for the help
Mike
Upvotes: 0
Views: 749
Reputation: 122
So you can have IIS and NodeJS on same machine.
node.js allow you to write WEB application without the need of a separate HTTP server. You don't choose a port when you install nodejs. Each node.js application include it's own HTTP server and can choose what port it want listen. You must just take care not having IIS and a node application listening at the same port.
Upvotes: 1
Reputation: 150624
You don't set up a port number when installing Node.js. Node does not use a port at all, as long as you do not tell it to use one, e.g. for an HTTP or a TCP server. Which port is used then depends on what you do programmatically with Node.js, e.g.:
'use strict';
var http = require('http');
http.createServer(function (req, res) {
// Do something with request and response
}).listen(3000);
The last call (the one to the listen
function) tells Node.js to use port 3000
, but you can use an arbitrary port here.
So, to cut a long story short: No, there won't be any problems, as long as you do not try to use a port within Node.js that is already being used by IIS.
Another option is to set up Node.js so that it runs in context of IIS, then of course you do not have any problems, too, but if I got your question correctly, you do not want to do that, but want to run Node.js separately.
Upvotes: 3