Building and running the connector server
To deploy a connector to a production instance of i2 Analyze that includes the i2 Connect gateway, the SDK includes commands for:
Building the service code without starting the server
Starting the connector server and its services as they were last built
To build the services and do nothing else:
npm run build
To run a server whose services have already been built:
npm run serve
When you deploy to a production instance of i2 Analyze, you must ensure that the target system's command access control settings are configured so that its users can see your connector. The procedure for doing so is the same as it is during development and testing.
Configuring the connector server
You can configure the connector server in a particular connector project through the settings file at config/server.json
, or by using environment variables. In new projects, the generated settings file contains the minimum amount of configuration to get your connector server running. You should review the settings to ensure that they are appropriate for your deployment:
{
"serverPort": 3000,
"connectorId": "<populated at creation>",
"ssl": {
"enabled": false,
"serverPort": 3443,
"privateKeyFile": "",
"certificateFile": "",
"gatewayCN": "",
"caCertificateFile": ""
},
"log": {
"level": "info",
"fileLogging": {
"enabled": false,
"dir": ""
}
}
}
The table below describes the settings and provides the names of the environment variables that you can use to override them.
JSON setting | Environment variable | Type | Description |
---|---|---|---|
serverPort |
SERVER_PORT |
number | The port number for connections to the connector server. |
connectorId |
CONNECTOR_ID |
string | The identifier of the connector. |
ssl.enabled |
SSL_ENABLED |
boolean | Whether SSL is enabled. |
ssl.serverPort |
SSL_SERVER_PORT |
number | The port number for SSL connections to the connector server. |
ssl.privateKeyFile |
SSL_PRIVATE_KEY or SSL_PRIVATE_KEY_FILE |
string | The path to the .pem file for the key. An optional passphrase associated with this private key can be supplied in the environment variable SSL_PASSPHRASE . |
ssl.certificateFile |
SSL_CERTIFICATE or SSL_CERTIFICATE_FILE |
string | The path to the .pem file for the certificate. |
ssl.gatewayCN |
SSL_GATEWAY_CN |
string or string[] | The gateway common name or names. |
ssl.caCertificateFile |
SSL_CA_CERTIFICATE or SSL_CA_CERTIFICATE_FILE |
string | The path to the trusted CA certificate. |
log.level |
LOG_LEVEL |
string | The minimum message level to log. Messages at lower levels are ignored. The value can be one of the following:error warn info debug |
log.fileLogging.enabled |
LOG_FILE_LOGGING_ENABLED |
boolean | Whether file logging is enabled. |
log.fileLogging.dir |
LOG_FILE_LOGGING_DIR |
string | The directory to log to. |