initialModules
Description
initialModules specifies a list of alias names that map server URLs to Profound.js module files. The setting is an object of name/value pairs, where the name is the URL alias and the value is either a module file reference or a configuration object.
Profound.js modules are stored in the modules directory under the Profound.js installation directory, which is further subdivided into subdirectories where JavaScript code is stored.
A module name can be qualified with a subdirectory name, as in "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.
Example 1: Qualified and Unqualified Modules
initialModules: {
"/alias1": "module1", // "pathlist" is used to search for a module named module1.js
"/alias2": "subdir/module2" // module file is modules/subdir/module2.js
}Example 2: Running Without IBM i Authentication
When running on IBM i, initial modules require authentication by default. To allow a module to run without authentication, specify the entry as an object:
initialModules: {
"/alias1": "module1", // Requires IBM i authentication
"/alias2": { "module": "module2", "authenticate": false } // Does not require IBM i authentication
}The modules above are then called with the following URLs respectively:
http://server:port/alias1;http://server:port/alias2.
When running modules without IBM i authentication, the Profound.js Connector APIs run as the PROFOUNDJS user profile, unless connectorCredentials is set to specify an alternate IBM i user id and password.
Example 3: Calling From the Profound UI Mobile Client
To configure Profound.js to receive a connection request from the Profound UI Mobile Client, use the special name "mobile" instead of a URL alias:
initialModules: {
"mobile": "subdir/module"
}Calling From an IBM i Session or Job
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. In those cases the library and program name within the session are mapped to a subdirectory within modules and a JavaScript file name respectively.
For information on how to modify this setting, see Configuration File.