Node.js On Localhost, With A Custom Domain

published on May 22, 2013 in technical

I had to direct my browser to a node.js application, running on a custom port on my Mac. Easy? Yes. Here's how.

I realized that I only need to run the Node.js application on port 80 and instruct the browser to direct the domain to my intranet IP address.

The first one is easy, only needed to run node as root, which is not a good idea, but does it in my development environment.

The other thing I did is set the IP address for the domain in the /etc/hosts file.

That's it. Things are working perfectly.