RUNNING

I have provided a number of free code examples to get you started with node.js

They should be visible as links next to this one.

The main one is called listener.js and is documented in the comments provided at the top of the file.

If you save listener.js to your node test folder (such as C:\Program Files\nodejs) then you can start the listener by entering the Windows CMD prompt and typing node listener.js (from the folder that listener.js resides).

Also download the small test files default.js and processRequest.js to the same folder.The code examples do not fit on the page very well (lots of wrap), but if you copy the text and paste into an editor (such as Notepad++ or Eclipse) then they should be very easy to read. Please save them with the suggested file names.

Before trying this please ensure that you have read my post regarding Installing node.js for Windows and confirm that node is correctly running.

If the listener runs correctly, then the node command prompt will display the message Server listening on port: 8080/

If you do not get the server message then please recheck the installation instructions and ensure that your are in the correct CMD folder for accessing the listener.js file. For example, if your listener.js file was loaded to C:\Program Files\nodejs then your CMD line should show C:\Program Files\nodejs>node listener.js

Now that your listener is running, you need to test it in a web browser. This should be easy, you can just click on this link and you will be able to test that your node.js listener service is working: http://127.0.0.1:8080/?one=queryparam1&two=queryparam2

If the browser tells you that it is unable to connect then your node.js listener is not running.

Assuming it all worked, you should now look for all the ACTION comments in the listener.js file and start customising the code to handle requests in the way you would like it to.