For the complete documentation index, see llms.txt. This page is also available as Markdown.

Hostname

The Hostname() function returns the domain name of the active portal of your published WEM project.

For more information about the domain name visit https://en.wikipedia.org/wiki/Domain_name.

This function can be used to create links to (specific pages of) your application. For example a link in a reset password or create account e-mail (see syntax for an example). By using the hostname function you ensure that the generated link always points to the right portal in the right environment.

Portals/applications can have multiple hostnames, and this function will return the Hostname which was used at the first incoming external Request (from a user session).

This function is SQL compatible - as it is a constant value within a session. For more information about SQL compatibility, see our documentation.

Syntax

Hostname()

Hostname() => portalname.staging.wem.io (on staging runtime) => portalname.live.wem.io (on live runtime) => yourcustomhostname.extension (on live runtime) => applicationservice (when used in WEM Scheduled Task on Kubernetes Runtime)

"https://" + Hostname() + "/create-account" => https://portalname.staging.wem.io/create-account (on staging runtime) => https://portalname.live.wem.io/create-account (on live runtime) => https://applicationservice/create-account (when used in WEM Scheduled Task on Kubernetes Runtime)

Last updated

Was this helpful?