Rustango docs

Resolving tenants & the operator console

Map the request host to a tenant; manage tenants from the apex.

A resolver chain maps each request to an Org. The default SubdomainResolver matches the Host header against Org.host_pattern; the apex domain (RUSTANGO_APEX_DOMAIN) is reserved for the operator console. In a handler, add the Tenant extractor and query through t.pool().

async fn dashboard(t: Tenant) -> Result<Json<Vec<Project>>, RustangoError> {
    Ok(Json(Project::objects().fetch(t.pool()).await?))
}

The apex is the console

Requests to the apex domain hit the operator surface (tenant CRUD + login), not a tenant. Give tenants their own hosts via host_pattern.