Launch the nodejs interpreter typing:
~# nodejs >
at prompt ">" type:
> console.log("Hello"); Hello
Now we are ready to try the first nodejs example from its web site http://nodejs.org.
This is an example of minimal web server written in Node that responds with a "Hello World" message to every web request.
Install the playground directory with all the code examples available on this site following this article: Programming examples on GitHub.
Then move into playground directory and type:
~# cd playground ~/playground# cd nodejs ~/playground/nodejs# nodejs web1.js Server web running on board
Open a web browser and access to board URL on: http://fox_ip_address:81 to get the message "Hello World";