// Port on which to run the service.
configurable int port = 8080;

// Password must be supplied in configuration file.
// configurable string password = ?;

Configurable Variables

A module-level variable can be declared as configurable. The initializer of a configurable variable can be overridden at runtime (e.g., by a TOML file). A variable where configuration is required can use an initializer of ?. The type of a configurable variable must be subtype of anydata.

configurable int port = 8080;

Port on which to run the service.

Password must be supplied in configuration file. configurable string password = ?;

bal run configurable_variables.bal