Summary#
A link that leaves the page — in an email, a webhook, a sitemap — needs the app's whole address, not a path:
entity Article {
[MaxLength(120)] string Slug;
security { allow read when IsAuthenticated; }
}
string LinkTo(Article a) { return App.BaseUrl + "/help/" + a.Slug; }App.BaseUrl is https:// and the host, with no trailing slash, so a path that starts with / joins it cleanly.
Signature#
string App.BaseUrl // "https://help.example.com" — scheme and host, no trailing slash
string App.Domain // the platform's own domain apps are served under
string App.Slug // the app's own name in its platform addressDescription#
Which address it is#
During a request, App.BaseUrl is the address that request arrived at — a person on your custom domain gets links
on your custom domain, and a person on the platform address gets links there.
Where no request says — a workflow sending mail, a scheduled job, a webhook delivery — it is, in order:
- the app's primary custom domain, when that domain is verified for the environment doing the work;
- else the environment's one verified custom domain;
- else the app's platform address.
Several verified domains and none marked primary keep the platform address: picking one would put your links on a domain you may be retiring. Marking one primary (on Osyrin Cloud, Make primary on the application's Domains tab) settles it, and a primary domain that stops verifying gives way to the next answer until it verifies again.
The platform address sends visitors to your domain#
Once the custom domain an environment is known by has its certificate, a browser opening the platform address is
redirected to the same page on that domain. So App.BaseUrl during a page visit is your domain however the visitor
arrived, and a link you mailed before the domain existed still lands on it. Webhooks and API calls to the platform
address are served there as before and are not redirected — during such a request App.BaseUrl is the platform address.
Read each time#
It is answered when it is read, not when the app starts, so a domain verified, made primary or removed while the app runs is what the next mail links to. Nothing to restart.
See also#
- Http.* — calling out to other hosts
- Every language's page, for a search engine — hreflang, canonical, sitemap — a sitemap built on
App.BaseUrl - Serving an app at your own domain — adding a domain, its records, and what changes once it has a certificate
- The standard library — and where each call runs — the rest of the standard library