In the 4th (and last) part of this node.js series, we will show you how to serve static (file) content from a node.js server. We will use the generated client files of part 2 for this (because only showing hello world from the cloud in part 3 is not cool enough 🙂 ).
Continue reading
Author Archives: AndreM
Server-side Node.js (part 3): Node.js in the cloud (free hosting!)
As mentioned in the first part, node.js was initially developed for the cloud. While there are enough paid hosting providers available, much nicer is of course to get it running for free! :). We will try to get our node.js server of part 2 up and running in the cloud…
Continue reading
Server-side Node.js (part 2): Real-time duplex communication
After the simple introduction of node.js in part 1, we are going to show you how to use realtime communication with server side pushing(!) data directly to all clients. So goodbye polling, hello full duplex websockets!
Continue reading
Server-side Node.js (part 1): Introduction
In the new version 2 of Smart Mobile Studio you can now create server side projects! This is possible by using node.js, which is “the next big thing”: It’s an event based server side JavaScript application using the open source and very fast Google’s V8 engine. It was initially developed to be used as a HTTP server in the cloud, but nowadays you can also use it on your own PC or on a business server. It is powered by a small executable (6 MB) which doesn’t need an installation. Still, it can be extended easily via the package manager npm to fulfill any desired purpose and make it versatile in a lot different situations. For example, it is used by LinkedIn, WalMart and even Microsoft(!) in the Azure cloud. Also, PayPal has recently switched from Java to Node.js…
When you start using node.js, be aware that it is very different to web browser programming: it is a server with no GUI, so no ‘document’ and ‘window’ globals and no ‘alert’ function. It doesn’t run in a sandbox so you access all files, databases etc like you can with a normal application. It has it’s own API for this, which cannot be compared to “JavaScript for HTML”: it is just JavaScript and has nothing to do with web browsers.
But be aware: it is fun and addictive! 🙂