Configurationdeclares a property for each key in a configuration file. For example, see the following
config.yaml, use a
$-prefixed environment variable name instead of a value:
DATABASE_CONNECTION_URL's value were
"postgres://user:[email protected]:5432/test", the value of
TodoConfiguration.databasewill be that string at runtime.
config.src.yaml. The latter is the configuration source file. The configuration source file declares key-value pairs that will be used when running the application tests. Deployed instances use
config.yamlthat will be read on deployed applications, providing documentation for your application's configuration.
config.yamlfile with connection info for a production database:
config.src.yamlwould have connection info for a local, test database:
config.yamlis checked in depends on how you are deploying your code. If you are using environment variables to control application configuration, you should check
config.yamlinto source control and provide
$-prefixed environment variable values. If you are using managing configuration files on each deployed instance, do not check
config.yamlinto source control because it'll be a different file for each instance.
local.yamlwith values for running the application locally, e.g. when doing client testing. Use
conduit serveto use a non-default name.
ApplicationChannels will likely create services that they use to respond to requests. In order for application tests to complete successfully, these services must be "closed" when the application stops. For built-in services, like
PostgreSQLPersistentStore, this happens automatically when
ServiceRegistryautomatically stops registered services. Registration looks like this:
ServiceRegistry.closewill not complete until the
ServiceRegistry.defaultInstanceis closed in
Application.stop(), any registries created by the programmer must be closed manually.
ServiceRegistry.registeris the object being registered. This makes registration syntax a bit more palatable:
Controllerthat will respond to the real request.
FooControllergenerates the preflight response:
policyhas properties for configuring CORS options for that particular endpoint. By having a
Controllerautomatically implements logic to respond to preflight requests without any additional code.
CORSPolicy.defaultPolicycan be modified at initialization time to set the CORS options for every controller.
policyin its constructor.
conduit serve, a Conduit application will configure itself to only allow HTTPS connections.
keyFilePathare set on the
ApplicationOptionsyour application is being run with. (If you are not using
conduit serve, you can set these values directly when instantiating
ApplicationChannel. By default, this property will create a
keyFilePathin the channels's
SecurityContextallows for password-encrypted credential files, configuring client certificates and other less used HTTPS schemes.