We will build a small web application to learn how to use the different technologies. For that we need to install some requirements:
Node.JS is cross-platform available. You can easily install it for any operating system by downloading the correct version here: http://nodejs.org/
Most package manager offer a way to install Node.JS but you should go to the website to install it from there :)
MongoDB comes in pre-compiled versions for almost all platforms. Just go to http://www.mongodb.org/downloads and download the respective binaries there. Unzip the file to a directory such as ~/MongoDB/
and make sure to add the path ~/MongoDB/bin
to your PATH
or create symbolic links using ln -s
in a folder that is already in your PATH
such as /usr/local/bin
.
Alternatively you can use any package manager. However I recommend you to use the latest version of MongoDB and they are sometimes not available in the package managers. So rather try to get 2.6.0-rc2
from the official page.
We will use Express.JS as a web server so we need to install it using the Node Package Manager (NPM) that we installed with Node.JS. So just open your favorite shell and run:
$> npm install -g express
We will install all other necessary modules in the project locally.
The non-hardcoded version of connecting to the socket.io server.