Crate server_env_config
source ·Expand description
Util types and functions to quickly and easy set up an HTTP server from environment variables.
See Config::init() for examples.
Modules
- The
DbConfigstruct represents settings used to establish a connection with a database. - The
Environmentenum represents possible deployment environments for an application. - The
HttpServerConfigstruct represents configuration for an HTTP server.
Structs
Configis responsible of the configuration of a “full” server, reading the settings from environment variables: the deployment environment, the HTTP server settings and database settings.
Functions
- Read boolean environment variable, accepting “0” or “false” as false values, and “1” or “true” values as true.
- Get a parsable value from an env value like a number, otherwise return
default_value.