How to build a website on Node.js?

drelkata picture drelkata · Jan 1, 2012 · Viewed 34k times · Source

I've just started diving into Node.js after several years of PHP programming and I would like to build a Node.js app for my next project, but I have no clue how to do it.

Are there any resources for a Node.js jumpstart?

Thanks in advance!

Answer

alessioalex picture alessioalex · Jan 1, 2012

You should think of Node.js as some kind of Apache + PHP, meaning that you can program your website and your webserver with Node.

Node has some important differences with your basic PHP, it's evented, asynchronous, non-blocking. You have to learn how to deal with callbacks, don't block the event loop and other things.

What you should do is try to learn the basic stuff with Node at the beginning, here are some great resources: https://stackoverflow.com/tags/node.js/info (my favorite has been nodetuts.com and the excellent book by it's author, Hands on Node).

After you've learned the basics, you can find Express really useful as a web framework and Socket.IO if your app is focused on real-time.