December 09, 2013
When deploying anode.js application to a azure website, the node.js environment variable process.env.port is set. One would think that port, is a the listening port and write something like this:
var port = process.env.port | 8080;
The problem? In azure website, port is not an int, it is a string. More problematic, it is not a port at all. It is a pipe. It looks something like this:
The good news, node.js can handle this. Be careful though, many modules for node.js are not expecting this to be the case and me have to be set up and initialized differently than the standard IP/Port examples. Hapi and Express for example can and have run on azure.
Written by Tony Gemoll. Shorter opinions found on twitter