Function Stack

Function Stack

As mentioned earlier, Catalyst supports two programming environments to develop the server-side functions in: Java and Node.js.

Java Functions

Catalyst provides a rich Java SDK containing classes and methods that includes the definitions of each Catalyst component. When you initialize a Java function in the CLI, the Java SDK will be downloaded and installed in your local system.

You can learn more about Java classes and writing a Java function in detail from the Java SDK documentation.

You can also manually download the Java SDK bundle from the Catalyst console and add it in your function's directory.

A Java function's directory is set up with three basic components by default, when you initialize the function:

  1. The main .java function file
  2. The catalyst-config.json configuration file
  3. The JAR library files in a folder named lib

You can learn about these in detail from the Project Directory Structure help page.

Node.js Functions

Catalyst provides an efficient Node.js SDK package containing methods and other necessary elements that define the behavior of the Catalyst components in the Node.js environment. The SDK package is installed as a part of the node modules folder, which also contains several Node packages with individual library files, license files, and configuration files, that are essential for the execution of your Node.js functions.

You can learn more about the Node.js SDK package and writing a Node.js function from the Node.js SDK documentation.

When you initialize a Node.js function from the CLI, or create it from the console, you can choose to include the Node module dependencies.

If you create the function without the dependencies, the function's directory will contain:

  1. The main .js function file
  2. The catalyst-config.json configuration file
  3. package.json

If you create the function with dependencies, the function's directory will contain:

  1. The main .js function file
  2. The catalyst-config.json configuration file
  3. package.json
  4. Node modules
  5. package-lock.json

You can learn about these in detail from the Project Directory Structure help page.

You can also manually install the Node.js SDK package any time by executing this CLI command: npm install zcatalyst-sdk-node.

 

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocatalyst.com