Go here to get started with Node.js on IBM i
##The chatserver powered by IBM i needs V7R1 and Node.js
5733-OPS Option 1 Node.js 0.x
5733-OPS Option 5 Node.js 4.x
5733-OPS Option 10 Node.js 6.x
##When you have installed Node.js 4.x set Node.js to V4
5250> qsh
$ /QOpenSys/QIBM/ProdData/OPS/Node4/bin/nodever.sh 4
Node.js v4 will now be used.
##When you have installed Node.js 6.x set Node.js to V6
5250> qsh
$ /QOpenSys/QIBM/ProdData/OPS/Node6/bin/nodever.sh 6
Node.js v6 will now be used.
##Check your Node.js and Node Package Manager version
5250> qsh
$ node -v
v6.9.1
$ npm -v
3.10.8
##Install express and socket.io with Node Package Manager
5250> qsh
$ npm install express
$ npm install socket.io
##Manual Install Create the following Directories and put the files in the directories
5250> qsh
$ mkdir -p /home/node (for the chatserver.js)
$ mkdir -p /home/node/html (for the index.htm)
$ mkdir -p /home/node/css (for the chatstyle.css)
$ mkdir -p /home/node/js (for the chatclient.js)
##Start the Node.js chatserver.js program on your IBM i
5250> qsh
$ node /home/node/chatserver.js
Server listening at port: 8020
When the port 8020
is used on your machine use another port and change it in the chatserver.js
script
line 5 var conf = {"port": 8020};
##check the port on IBM i:
5250> netstat *cnn
##Start the chatclient
Open the browser of your choice and type http://yourip:8020