# @stacksjs/sites Request-level multi-site tenancy: one Stacks app serving many public web properties, each resolved from the request's Host header. A host resolves in this order: 1. exact match on a **verified** `site_domains.domain` row (custom domains) 2. `{subdomain}.{config.sites.baseDomain}` matching `sites.subdomain` 3. a configured platform host (the app itself) - no site, never 404'd 4. nothing - null, or 404 when `config.sites.strict` is on ## The two channels - **API / bun-router:** the `siteResolver` middleware stamps `request.site` and the ambient AsyncLocalStorage context (`currentSite()`, `requireSite()`). - **STX pages:** the view servers resolve the site after an `await` in stx serve's `onRequest` hook, and the ALS context `setCurrentSite` enters there ends with the hook, before the render. The serving layer stores `toSiteSnapshot(site)` on the request's snapshot (`enterRequestScope` in `@stacksjs/config`), and `