Skip to main content

url

Function url 

Source
pub fn url(gateway: &str) -> &'static str
Expand description

Returns the base URL for gateway in the current environment, without a trailing slash (so paths can be appended directly, e.g. {url}/webhooks/stripe).

This returns the first origin listed for the gateway in crate::env::app_meta. gateway must match the exact name declared in encore.gateway.json or the hosting service (for example, public_api does not match public-api).

§Panics

Panics if no URL is configured for gateway — either because the app has no gateway with that name or because the environment provides no origins for it.