HTML and CSS Reference
In-Depth Information
Table E.1. Node.js prerequisites by platform
Platform
Prerequisites
Linux
GCC 4.x.x; GNU make 3.81 or newer; Python 2.6 or 2.7
Unix/BSD
GCC 4.x.x; GNU make 3.81 or newer; Python 2.6 or 2.7; libexecinfo
Mac
Xcode 4.5; GNU make 3.81 or newer; Python 2.6 or 2.7
Windows
Visual Studio 2010 or Visual C++ 2010 Express; Python 2.6 or 2.7
Once you've installed your prerequisites correctly you can get started. This appendix will
walk you through a few simple example Node applications, which will confirm that your
installation is correct and let you see how common web application scenarios are handled
in Node.
E.1.1. Create a Node Hello World application
In this section you'll build, in two steps, the traditional Hello World application shown in
figure E.1 . You'll generate a page entirely dynamically using JavaScript.
Figure E.1. Node says “Hello World.”
Step 1: Create a Node application
The first listing is a simple Hello World application for Node, as shown in figure E.1 .
Create a file called app.js in your working directory and place this code into it.
 
 
 
Search WWH ::




Custom Search