Configuration File
Overview
Profound.js configuration settings are stored in a file named config.js within the Profound.js installation directory. The settings are exported as a JavaScript object and can be described in JSON format; each property within the object represents one Profound.js setting.
Whenever config.js is modified, you must restart the Profound.js instance for the new configuration to take effect. If a property fails validation, the instance reports the error and does not start.
Example
The file below is close to what a new installation produces. It serves static files from htdocs, exposes two sample modules as URL aliases, defines a default IBM i database connection, and listens on port 8081.
config.js
module.exports = {
// Directory served for static files (HTML, CSS, images, and so on).
"staticFilesDirectory": "htdocs",
// Directories under "modules" that Profound.js searches when resolving a module.
"pathlist": [
"pjssamples"
],
// URL aliases that map straight to a module.
"initialModules": {
"/hello": "pjssamples/hello",
"/connect4": "pjssamples/connect4"
},
// Database connections. One entry may be flagged as the default.
"databaseConnections": [
{
"name": "default",
"default": true,
"driver": "IBMi"
}
],
// Session timeout, in seconds (1 hour).
"timeout": 3600,
// Port the server listens on.
"port": 8081
}Editing the File
End the instance;
Edit config.js in the installation directory – on IBM i this can be done from a PASE shell, from the IFS through IBM i Access, or with any editor that can write to the IFS;
Start the instance and confirm no configuration errors were reported at startup.
Some values, such as stored credentials and encrypted sslOptions, require an encryptionKey to be configured before they can be used.
Available Properties
Each configuration property is documented on its own page. The full list is below, in alphabetical order.
- Deprecated Configuration Options
- additionalStaticPaths
- apiPrefix
- appendPJSPathlist
- asyncArrayIteration
- authenticate
- autoAsyncAwait
- autoTesting
- basicAuthCredentials
- captureCallStack
- coderflow (configuration option)
- compression
- connectorAllowUnsafe
- connectorCredentials
- connectorIASP
- connectorIPFilter
- connectorLibrary
- connectorPassword
- connectorTimeout
- connectorURL
- connectorUser
- custom
- customAuthentication
- customHttpHeaders
- databaseConnections
- dateFormat
- dateSeparator
- db2ConnectionPoolSize
- decimalFormat
- defaultMode
- deferDefine
- designer
- displayErrors
- enableAtrium
- enableAutomatedTesting
- enableConnector
- enableCORS
- enableDbDefn
- enableRDFCompile
- encryptionKey
- errorScreen
- getAttnProgram
- gitPath
- gitSupport
- host
- hotReloading
- htmlTemplate
- httpRequestAPITimeout
- ideAllowedProfiles
- initialModules
- inspector
- keepColNameCase
- localIdeSettings
- logDirectory
- logging (logging options)
- mailTransport
- msgFileType
- onerror
- onLicenseEvent
- onPrinterFileClose
- paiPrivateKey
- paiPublicKey
- pathlist
- pjscallKeys
- pjscallSocketTimeout
- port
- preciseDecimal
- preRouting
- preserveFieldNames
- profounduiIntegrationMode
- profounduiLibrary
- profounduiServerURL
- redirectHTTP
- requestSizeLimit
- runCcsid
- runMixCcsid
- saveResponseBody
- searchModulesPaths
- securePort
- setProgramSQLDefaults
- sflMsgQueueType
- shell
- shellArgs
- showIBMiParmDefn
- socketInactivityTimeout
- sourceCcsid
- sslCert
- sslKey
- sslOptions
- staticFields
- staticFilesDirectory
- staticOptions
- swaggerStatsEnabled
- tcpKeepAlive
- timedTasks
- timeFormat
- timeout
- timeSeparator
- userdataDirectory
- userEditCodes
- widgetBackend
- workWithSessions
- wsCompressionThreshold
- wsOptions
Deprecated Options
The options below still work but should not be used in new configurations. They are kept for reference in the Deprecated Configuration Options folder at the end of the list above.
Option | Status | Use instead |
|---|---|---|
Deprecated. A message is written to stderr at startup when it is used. | ||
Deprecated. A message is written to stderr at startup when it is used. | ||
Deprecated. A message is written to stderr at startup when it is used. | ||
Deprecated from Profound.js 5.0.0. Cannot be combined with the replacement. | ||
Deprecated from Profound.js 5.0.0. Cannot be combined with the replacement. | ||
Deprecated from Profound.js 7.6.0, and has had no effect since 6.1.0. | ||
Has had no effect since Profound.js 5.0.0. | — no equivalent |
Specifying a deprecated option does not stop the instance from starting. The three access log options and shortHttpTimeout write a deprecation message to stderr at startup, so check the instance log if you are unsure whether a configuration still uses them.