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";
Acme Systems srl
Via Aldo Moro 53 - 00055 Ladispoli (RM) - Italy
Partita IVA / Codice Fiscale 08114831004 - Tel +39.06.99.12.187 - Fax +39.06.622.765.31 - email: firstname.lastname@example.org pec: email@example.com
Iscritta al Registro delle Imprese di Roma al n. 08114831004 - REA: RM-1074631