[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

Node walkthrough

The Node platform is an offline (console based) mode of development of server side applications using S8. If you are not familiar with Console mode, It is strongly recommended that you check Console Mode walkthrough before continue.
The platform contains a set of tools to do development and testing of server side applications/frameworks. The user start with an empty draft folder with guides on how to develop Node.js based servers.
The server application can boot from files or be image based.
Console version of S8vm can be used to build iamges/modules that load dynamically in server system.
The server application can be uploaded as normal javascript application (a snapshot of the server system can be built and uploaded to server).

Let's try a traditional HelloWorld sample.
  1. Download the Node contribution

  2. Check the minimal information in contribution page. Install Node.js if needed.

  3. Create a folder (in this walkthrough this folder is called N8TestWalkthrough) and Unzip node.zip contribution.

  4. Also download the console contribution for your platform: Win 32 bits, Win 64 bits, Mac OSX, Linux and copy the s8vm.exe (or s8x64.exe) at the N8TestWalkthrough folder
    NOTE: Take care if you move s8vm.exe/s8x64.exe to other folders, please check Moving s8vm.exe to other location
    Uploaded Image: N81.PNG

  5. In node folder you sholud see:
    Uploaded Image: N8-2.PNG
    n8.snapshot.js file is a pre-compiled snapshot included in the contribution. The n8.bat batch file is the main script to execute the n8.sanpshot.js in node.

  6. Let's check build folder.
    Uploaded Image: N8-3.PNG
    cmd8, chat, hello folders correspond to samples included in the contribution. The _build.bat batch file invoques the compilation of source code defined y build.js. Again, If you are not familiar with Console mode, it is strongly recommended that you check Console Mode walkthrough to understand what is going on here.

  7. Edit build.js file and comment load(cmd8/build.js) statement and uncomment load(hello/build.js):
    File: N8TestWalkthrough\node\build\build.js

  8. Goto the console and execute _build.bat batch file:
    Uploaded Image: N8-4.PNG

  9. A new n8.snapshot.js file was generated. Go to N8TestWalkthrough\node folder and launch the server executing n8.bat.
    The console will show a 'Server running at' leyend.

  10. Open a web browser and point to:
    Uploaded Image: N8-5.PNG
    Congratulations! Welcome to server side development!