Configuration¶
The server can be configured using environment variables or command-line switches:
Environment variable | Command-line switch | Default | Description |
---|---|---|---|
KTOR_DEVELOPMENT |
-Dio.ktor.development= |
true |
Run in development mode, enabling auto-reload and increasing verbosity. |
KTOR_DEPLOYMENT_PORT |
-port= |
8080 |
Port to listen on. |
KTOR_DEPLOYMENT_SSL_PORT |
-sslPort= |
SSL port to listen on. Note: KTOR_SECURITY_* must be set with this. |
|
KTOR_SECURITY_SSL_KEY_STORE |
-sslKeyStore= |
Path to the SSL key store. | |
KTOR_SECURITY_SSL_KEY_STORE_PASSWORD |
-P:ktor.security.ssl.keyStorePassword= |
Password for the SSL key store. | |
KTOR_SECURITY_SSL_KEY_ALIAS |
-P:ktor.security.ssl.keyAlias= |
Key alias in the key store. | |
KTOR_SECURITY_SSL_PRIVATE_KEY_PASSWORD |
-P:ktor.security.ssl.privateKeyPassword= |
Password for the private key. | |
SQLDELIGHT_DIALECT |
-PsqldelightDialect= |
sqlite:3.18 |
SQL dialect from SQLDelight's available options. Note: Read at compile time, not runtime. Note: Must be consistent with the datasource below. |
HIKARI_DATASOURCE_CLASSNAME |
-P:hikari.dataSourceClassName= |
org.sqlite.SQLiteDataSource |
Class name provided by the JDBC driver. See Hikari's options. Note: must be consistent with the dialect above. |
HIKARI_DATASOURCE_URL |
-P:hikari.dataSource.url= |
jdbc:sqlite: (in-memory) |
Location of the database file. Applicable to file-based databases, like SQLite. |
HIKARI_DATASOURSE_DATABASE_NAME |
-P:hikari.dataSource.databaseName= |
Depends on the JDBC driver. | Name of the database. Applicable to connection-based databases, like PostgreSQL or MariaDB. |
HIKARI_DATASOURCE_SERVER_NAME |
-P:hikari.dataSource.serverName= |
localhost |
Name of the server. Applicable to connection-based databases, like PostgreSQL or MariaDB. |
HIKARI_DATASOURCE_PORT_NUMBER |
-P:hikari.dataSource.portNumber= |
Depends on the JDBC driver. | Port number. Applicable to connection-based databases, like PostgreSQL or MariaDB. |
HIKARI_DATASOURCE_USERNAME |
-P:hikari.dataSource.username= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_PASSWORD |
-P:hikari.dataSource.password= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_AUTO_COMMIT |
-P:hikari.dataSource.autoCommit= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_CONNECTION_TIMEOUT |
-P:hikari.dataSource.connectionTimeout= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_IDLE_TIMEOUT |
-P:hikari.dataSource.idleTimeout= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_KEEPALIVE_TIMEOUT |
-P:hikari.dataSource.keepAliveTimeout= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_MAX_LIFETIME |
-P:hikari.dataSource.maxLifetime= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_CONNECTION_TEST_QUERY |
-P:hikari.dataSource.connectionTestQuery= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_MINIMUM_IDLE |
-P:hikari.dataSource.minimumIdle= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_MAXIMUM_POOL_SIZE |
-P:hikari.dataSource.maximumPoolSize= |
Refer to Hikari's options. | |
HIKARI_DATASOURCE_POOL_NAME |
-P:hikari.dataSource.poolName= |
Refer to Hikari's options. |
The defaults are adequate for local development.
Production¶
When running in production, disable development mode, and switch to an adequate database configuration and dialect.