Crate leptos_config

Crate leptos_config 

Source

Modules§

errors

Structs§

ConfFile
A Struct to allow us to parse LeptosOptions from the file. Not really needed, most interactions should occur with LeptosOptions
LeptosOptions
This struct serves as a convenient place to store details used for configuring Leptos. It’s used in our actix and axum integrations to generate the correct path for WASM, JS, and Websockets, as well as other configuration tasks. It shares keys with cargo-leptos, to allow for easy interoperability

Enums§

Env
An enum that can be used to define the environment Leptos is running in. Setting this to the PROD variant will not include the WebSocket code for cargo-leptos watch mode. Defaults to DEV.
ReloadWSProtocol
An enum that can be used to define the websocket protocol Leptos uses for hotreloading Defaults to ws.

Functions§

get_config_from_env
Loads LeptosOptions from environment variables or rely on the defaults
get_config_from_file
Loads LeptosOptions from a Cargo.toml with layered overrides. Leptos will read in the settings itself. This option currently does not allow dashes in file or folder names, as all dashes become underscores
get_config_from_str
Loads LeptosOptions from a Cargo.toml text content with layered overrides. If an env var is specified, like LEPTOS_ENV, it will override a setting in the file.
get_configuration
Loads LeptosOptions from a Cargo.toml with layered overrides. If an env var is specified, like LEPTOS_ENV, it will override a setting in the file. It takes in an optional path to a Cargo.toml file. If None is provided, you’ll need to set the options as environment variables or rely on the defaults. This is the preferred approach for cargo-leptos. If Some(“./Cargo.toml”) is provided, Leptos will read in the settings itself. This option currently does not allow dashes in file or folder names, as all dashes become underscores