This task details the steps to verify you can run a Node.js application in CICS, and
where to find useful diagnostic feedback if you see unexpected results.
Before you begin
Install IBM® SDK for Node.js -z/OS®, and grant read and execute permissions to its install directories for the CICS region
userid. Confirm the CICS bundle directory /usr/lpp/cicsts/cicsts55/samples/nodejs/nodejsivp
exists.
Procedure
- Copy the CICS bundle directory and its contents to a new location of
your choice.
For example: cp -R /usr/lpp/cicsts/cicsts55/samples/nodejs/nodejsivp
/u/jdoe/
- In the copy of the CICS bundle, edit the Node.js profile
profiles/ivp_sample.profile.
Update the following environment variable:
PORT=
Set to an available HTTP port number that the Node.js application can use
to service web browser requests. The port cannot be shared with other applications.
- The Node.js profile in the CICS bundle contains a
%INCLUDE
statement
that references a zFS file containing system-wide Node.js configuration data. Create this file at
the following location: <USSCONFIG>/nodejsprofiles/general.profile,
replacing <USSCONFIG> with the value of the USSCONFIG SIT
parameter in the target CICS region. This file must set the following values:
NODE_HOME=
Set to the IBM SDK for Node.js -z/OS installation directory.
WORK_DIR=
Set to the directory where output diagnostic files are written. A
value of .
means the home directory of the CICS region user ID.
- Copy the sample resource definition DFHNJIVP from group
DFH$NODJ to a group of your choice.
- Edit the copy of DFHNJIVP to set the BUNDLEDIR
attribute to the directory of the copy of the CICS bundle from step 1.
- Install the copy of DFHNJIVP. The Node.js application starts and
listens for HTTP requests.
- Use a web browser to send an HTTP request to the Node.js application.
For
example:
http://hostname:port/ where
hostname is the fully
qualified host name of the TCP/IP stack on z/OS on which CICS is running, and
port is the value that is selected at step
2.
The web browser shows the response
"Congratulations, you have successfully run Node.js IVP Application
IVPSAMPLE.".
What to do next
If the web browser does not show the expected response, review the diagnostic information
in Troubleshooting Node.js applications.