- Understand the pre-requisites to running your Node.js application in CICS
- How to deploy a sample Node.js application
- How to deploy your own Node.js application
Before we begin this 5-step process to running your Node.js application in CICS, if you’re wondering what Node.js is or why it could be the basis for aggregating APIs and new web apps for your CICS applications, watch our intro video. Also read the FAQs for system programmers and architects and developers. In this article however, let’s dive straight in with tips and links on how to get started installing Node.js in CICS.
The steps below take you through installing the software necessary to run your first Node.js application in CICS.
Step 1. Install IBM SDK for Node.js – z/OS, Version 8
The SDK is required to run Node.js applications on z/OS. The SDK includes the Node.js Package Manager (npm) command line tool to resolve and download dependencies. Some packages include C/C++ source code so the SDK also includes a 64-bit C/C++ compiler (njsc/njsc++) with C++11 language support that npm will use when installing dependencies. The SDK is free to use with optional paid-for support.
Download the SDK as a pax.Z file or SMP/E edition, then follow the instructions in Installing the IBM SDK for Node.js to install it and its requirements. Note the environment variables that you will need to set in your z/OS UNIX shell login .profile so you can run node and npm.
At this point, you could experiment running a Node.js application in your z/OS UNIX shell. Upload the application using FTP or similar into your home directory, tag the files that are not encoded in EBCDIC using chtag, then run it using the node command line options:
node [options] [v8 options] [script.js | -e "script"] [--] [arguments]. You can use CTRL-C to stop the application.
Step 2. Install a CICS TS V5.5 region
Support for Node.js applications was added in CICS TS V5.5 as described in CICS and Node.js. You will need to install CICS TS V5.5 and start a CICS region. The topic Setting up Node.js support gives you an overview of the Node.js application profile, logging, and memory requirements, some of which are similar to how CICS supports Java.
Step 3. Deploy the sample Node.js application
You are now ready to run a simple Node.js application in CICS to test you have everything setup. The CICS installation includes an application that you can deploy by following the steps in Verifying the installation of the Node.js runtime. The Node.js application is started when the BUNDLE resource is enabled. When you call the application from a web browser it will display the message “Congratulations, you have successfully run Node.js IVP Application IVPSAMPLE.“. The application is stopped when the BUNDLE resource is disabled.
Step 4. Install CICS Explorer V5.5
CICS Explorer V5.5 added support for packaging Node.js applications in CICS bundles, and provides a new Node.js Applications operations view to give you the details about all Node.js applications running in CICS. Download CICS Explorer V5.5.
Step 5. Deploy your own Node.js application
Most Node.js version 8 applications will work in CICS, although there are a few limitations documented in Developing Node.js applications and Known issues and limitations. When you have developed an application that is ready to test, you will first need to package it into a CICS bundle using the procedure in Deploying Node.js Applications, and then export it to zFS as outlined in Deploying a CICS bundle.
Next, we need to resolve the application dependencies by starting a z/OS shell, changing directory to the location of the Node.js application within the CICS bundle, and running npm.
Finally, define a BUNDLE resource, install and enable it.
And there you have it, 5 steps to running your first Node.js application in CICS. If you have any questions about this process or anything about Node.js in CICS, we have an abundance of resources that you can pull from on the CICS Knowledge Center. As a forum to ask questions, why not go to dWAnswers and ask our community of experts, or comment on out page here? Keep an eye for future Node.js blogs here on the CICS Developer Center – bookmark it to your browser today.