I'm getting interested in nodeJS and the idea you can run JS on the server, so just wondering if anyone has some examples or can explain the potentialities of nodeJS (documentation on the site is not big)
I'm getting interested in nodeJS and the idea you can run JS on the server, so just wondering if anyone has some examples or can explain the potentialities of nodeJS (documentation on the site is not big)
Share Improve this question edited Feb 10, 2012 at 21:32 CommunityBot 11 silver badge asked Dec 7, 2010 at 12:53 sebarmelisebarmeli 18.3k7 gold badges37 silver badges42 bronze badges2 Answers
Reset to default 11I'm programing an app with nodejs right now, I can say that one of the biggest advantages is the performance. You can usa a documental dabase like mongoDB, and you'll have a turbo APP.
There is a web framework like Sinitra for Ruby, the ExpressJS, it's very simple to use, and does great to small apps. http://expressjs./
For database, mongoDB is very simple to use and works great with javascript, since you can read and persist JSON objects. http://www.mongodb/
To use mongoDB, there is the Mongoose module, it will abstract the usage and provides the connection. https://github./ciaranj/mongoose
Here is a tutorial to get started: http://howtonode/express-mongodb
If you want to play with cutting edge tech, then a really exciting avenue is nodejs + current draft specs of HTML5 WebSockets. Rob Hawkes' Rawkets is a great demo of this -- a realtime multiplayer rocket game (see Github source), that uses an NPM module called websocket-server, making it insanely easy to do realtime games in the browser. There are only 3 browsers that support WebSockets right now though: Chrome, Firefox and Safari. And I had to specifically enable it in Firefox 4 and 5 due to a security issue with the design of the spec as it stood. Firefox 6 implements the protocol that's fixed. There's a programmatic way to check whether WebSockets is implemented too