Deploying Node.js applications

You can deploy Node.js applications in a CICS bundle by creating a NODEJSAPP bundle part.

Before you begin

Before you begin this task, you need to identify the location of your Node.js application and the assets it needs, for example, images or HTML files.

Create a profile to specify the configuration information that CICS will use to start the Node.js runtime. You can also use this profile to specify environment variables that Node.js applications can access in order to configure their capabilities.

You need to locate a suitable CICS bundle project or create a new one.

You must either copy your Node.js application into a CICS bundle project or reference it in a separate zFS location.

About this task

You can create a NODEJSAPP bundle part in your CICS bundle by following these steps.

Procedure

  1. In CICS Explorer® in the Project Explorer view, right-click on the CICS bundle project and click New > Node.js Application.
    A wizard titled Create Node.js Application opens.
  2. Enter a name for the Node.js application bundle part. This name must be unique within the CICS region the bundle will be installed into. Click Next.
  3. Select the initial JavaScript file to run. You must ensure that the fully qualified path to the JavaScript file when exported to zFS is no more than 255 characters. Click Next.
  4. Select a profile for your Node.js application. You must ensure that the fully qualified path to the profile when exported to zFS is no more than 255 characters. Click Finish.

Results

When completed, the wizard creates a NODEJSAPP bundle part inside of the bundle project. If you selected a profile from your local file system or your Eclipse workspace, the profile is copied into your CICS bundle project. When the bundle is enabled, CICS uses configuration from the profile to start the Node.js runtime in order to execute the Node.js application initial JavaScript file.

What to do next

You can now deploy your CICS bundle project:

Deploy your CICS bundle project

Node.js applications typically have dependencies on external modules that need to be resolved before the application can run. After deploying your CICS project you will need to run the npm tool provided by IBM SDK for Node.js - z/OS from a z/OS UNIX System Services shell. For example, if the dependencies are described in a package.json file in the Node.js application, use the command npm install to download the dependencies from a repository and install them.