Configuration File

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

  1. End the instance;

  2. 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;

  3. 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 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

Option

Status

Use instead

accessLog

Deprecated. A message is written to stderr at startup when it is used.

logging

accessLogFormat

Deprecated. A message is written to stderr at startup when it is used.

logging

accessLogRotation

Deprecated. A message is written to stderr at startup when it is used.

logging

connectionDetails

Deprecated from Profound.js 5.0.0. Cannot be combined with the replacement.

databaseConnections

dbDriver

Deprecated from Profound.js 5.0.0. Cannot be combined with the replacement.

databaseConnections

shortHttpTimeout

Deprecated from Profound.js 7.6.0, and has had no effect since 6.1.0.

httpRequestAPITimeout

longHttpTimeout

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.