Exposing RPGLE as Webservices - Deploy and Secure Server

Deploying and Securing the Server

Install Express Globally (Optional for Generators): For project scaffolding tools, run npm install -g express. This installs the Express application generator system-wide.

/QOpenSys/pkgs/bin/npm install -g express
Exposing RPGLE as Webservices - Deploy and Secure Server 1
/QOpenSys/pkgs/bin/npm install -g express-generator
Exposing RPGLE as Webservices - Deploy and Secure Server 2

Now you can run your webservice using the NODE command and pointing it at your webfoodapp javascript:

/QOpenSys/pkgs/bin/node /home/youruser/webservice-food/webfoodapp.js
Exposing RPGLE as Webservices - Deploy and Secure Server 3

You will (hopefully) see: Food API endpoint live at http://localhost:3000/api/food

Exposing RPGLE as Webservices - Deploy and Secure Server 4

Here we now have our webservice ready to be called on url - http://your-system-name:3000/api/food

It will expect the json payload with the READ/ADD/UPDATE/DELETE request.

Change webservice PORT?

Simply edit your webfoodapp.js and repeat/restart it again:

Exposing RPGLE as Webservices - Deploy and Secure Server 5

For always-on service, use IBM i's job scheduler or PASE daemon.

For testing service, we can run the webserver from a PASE Terminal in VSCode.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>