const servers = await api.domains.servers();
const served = await domain.serve({ name: "docs", pages: servers[0].name });
// { hostname, target, project, status, certificate, note }servers = api.domains.servers()
served = domain.serve(name="docs", pages=servers[0]["name"])
# {"hostname", "target", "project", "status", "certificate", "note"}namestringrequiredThe hostname, relative to the zone — docs, www.
pagesstringrequiredWhat will serve it, from servers().
Why it is one call
The platform on the other end must recognise the name as well, or its edge refuses the connection — which reads as an outage. Writing the record alone is the mistake this call exists to prevent.
The certificate takes a moment
certificate comes back as its state. Until it is active the connection fails — a wait, not a fault. Check it before telling anyone the address works.
For a host created here, use the host
host.domains.attach() is the one for something hosted on IaGenify. This one is for serving a name from something else on the account.
Undoing it
unserve() removes both halves — the registration and the record.