shopFromHost
Extract the shop identifier from an HTTP host header.
Dev TLDs (.localhost / .test):
my-shop.storefront.localhost:443 → my-shop
demo.nordcom.store.storefront.localhost → demo.nordcom.store (dotted slug, mirrors prod)
my-shop.tenant.storefront.localhost → my-shop.tenant (everything before .app.tld)
storefront.localhost → '' (bare app, no shop)
localhost → '' (bare TLD)
Production:
shop.example.com → shop.example.com
SHOP.example.com → shop.example.com
shop.example.com. → shop.example.com (trailing dot stripped)
Returns '' for empty / malformed / un-parseable input.
Signature
function shopFromHost(host: string): string;Parameters
| Name | Type | Description |
|---|---|---|
host | string |
Related
ParsedHost AppName BuildEnv DevTld Hostname ShopHandle appFromHost isDevelopment