initialModules

"initialModules" specifies a list of alias names that map server URL's to Profound.js module files.

The setting is specified as an object of name/value pairs, where the name is the URL alias and the value is a reference to a file name or configuration object. 

Profound.js modules are stored in the modules directory under the Profound.js installation directory. The modules directory is further subdivided into subdirectories where JavaScript code is stored.

The module name can be qualified with a subdirectory name as follows: "subdirectory/module". If the module name is not qualified, the "pathlist" is used to search for the module. When searching for modules, a .js file extension is assumed.

The example below shows both a qualified and an unqualified module:

initialModules: { "/alias1": "module1", // "pathlist" is used to search for a module named module1.js "/alias2": "subdir/module2" // module file is modules/subdir/module2.js }

When running on IBM i, initial modules require authentication by default. To allow a module to run without authentication, specify the initalModules entry like this: 

initialModules: { "/alias1": "module1", // Requires IBM i authentication "/alias2": { "module": "module2", "authenticate": false } // Does not require IBM i authentication }

The modules can then be called using the following URL's respectively:

  • http://server:port/alias1

  • http://server:port/alias2

When running modules without IBM i authentication, the Profound.js Connector APIs will run as the PROFOUNDJS user profile, unless the connectorCredentials configuration option is set to specify an alternate IBM i user id/password.



Calling from Profound UI Mobile Client

To configure Profound.js to receive a request for a connection from the Profound UI Mobile Client, use the special name "mobile" instead of a URL alias, as follows:

initialModules: { "mobile": "subdir/module" }



Calling from IBM i session or job

Please note, the "initialModules" setting is not used when calling Profound.js modules from a Genie session, a 5250 green-screen session, or an IBM i Rich Display File program. Instead, the library and program name within the session is mapped to a subdirectory within modules and a JavaScript file name respectively.

 

Click here for information on how to modify this setting.