Skip to main content

Module env

Module env 

Source
Expand description

Metadata about the running application — its environment, build, deployment and API gateways.

ⓘ
let md = encore::env::app_meta();
if md.environment.r#type == encore::env::EnvironmentType::Production {
    // ...
}
// An app can declare several gateways, so look one up by name.
if let Some(gw) = md.gateway("api") {
    println!("api is at {}", gw.base_url);
}

The types are the core’s own: this crate links encore_sdk_core directly, so there is nothing to marshal and no reason to define a parallel set.

Structs§

AppMeta
BuildMeta
DeployMeta
EnvironmentMeta
GatewayMeta
An API gateway serving the application.
HostedService

Enums§

CloudProvider
EnvironmentType

Functions§

app_meta
Metadata about the running Encore application.