feat: production routing support for subdomain and custom domain modes
Some checks failed
CI / ruff (push) Successful in 10s
CI / pytest (push) Failing after 45m18s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped

Double-mount store routes at /store/* and /store/{store_code}/* so the
same handlers work in dev path-based, prod path-based, prod subdomain,
and prod custom-domain modes.  Wire StorePlatform.custom_subdomain into
StoreContextMiddleware for per-platform subdomain overrides.  Add admin
custom-domain management UI, fix stale /shop/ reset link, add
/merchants/ to reserved paths, and server-render window.STORE_CODE for
JS that previously parsed the URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 00:15:06 +01:00
parent 6a82d7c12d
commit ce5b54f27b
36 changed files with 822 additions and 151 deletions

View File

@@ -74,8 +74,9 @@ function data() {
? segments[segments.length - 2]
: last;
// Get store code from URL
if (segments[0] === 'store' && segments[1]) {
// Get store code from server-rendered value or URL fallback
this.storeCode = window.STORE_CODE || null;
if (!this.storeCode && segments[0] === 'store' && segments[1]) {
this.storeCode = segments[1];
}
@@ -281,14 +282,18 @@ function emailSettingsWarning() {
storeCode: null,
async init() {
// Get store code from URL
const path = window.location.pathname;
const segments = path.split('/').filter(Boolean);
if (segments[0] === 'store' && segments[1]) {
this.storeCode = segments[1];
// Get store code from server-rendered value or URL fallback
this.storeCode = window.STORE_CODE || null;
if (!this.storeCode) {
const path = window.location.pathname;
const segments = path.split('/').filter(Boolean);
if (segments[0] === 'store' && segments[1]) {
this.storeCode = segments[1];
}
}
// Skip if we're on the settings page (to avoid showing banner on config page)
const path = window.location.pathname;
if (path.includes('/settings')) {
this.loading = false;
return;