Page tree
Skip to end of metadata
Go to start of metadata

This API creates an Express callback from a Profound.js module which will receive the Express Request and Response objects as parameters. The returned function can be used with app.all(), app.get(), and similar Express APIs. If the configuration value connectorCredentials is set, this API can automatically sign on to IBM i. See Connecting to a Remote InstanceIf the instance is running on IBM i, a Profound UI session id can be passed on the request as a parameter named AUTH. If present, the API will automatically set the current user profile and library list of the connection to match the Profound UI session.


  • module (string or function):
    • If a string is passed, it should contain the path to or name of the Profound.js module to be wrapped. The function exported as "run" in the wrapped Profound.js module will be called. 
    • In order to pass a function, profoundjs.require() must first be used to load a module.  
  • authenticate (boolean, optional) [deprecated] 
    Pass true to log on to IBM i. The default value is false.

    Deprecated Parameter

     In Profound.js 4.8.2 or higher, the authenticate parameter is ignored. Sign on to IBM i will occur should the Connector APIs be called by the program.


In start.js
var isWorker = profoundjs.server.listen();
if (isWorker) {
  var app =;
function products(req, res) {
  pjs.defineTable("productsp", { keyed: true, read: true });
  if (productsp.found()) {
      prid: prid,
      prname: prname.trim(),
      prdesc: prdesc.trim(),
      prprice: prprice,
      primage: primage.trim(),
      prqty: prqty,
      prcatid: prcatid
  else {    
} = products;
Use with function directly - in start.js
var isWorker = profoundjs.server.listen();
if (isWorker) {
  var app =;
  var module = profoundjs.require("products.js");
  var myFunction =;


Video Tutorials