From 51cd0e3628774d45eb0ab4b20e4936b4fcc8f9f2 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Mon, 28 Sep 2026 22:12:17 +0000 Subject: [PATCH] Subdomain apps get /embed-test: every web plugin in the host's tree, embedded as JavaScript --- deployment/cloud/admin.mjs | 7 ++ deployment/cloud/embed-test.html | 134 +++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 deployment/cloud/embed-test.html diff --git a/deployment/cloud/admin.mjs b/deployment/cloud/admin.mjs index 3da6f5c62..364aafa79 100644 --- a/deployment/cloud/admin.mjs +++ b/deployment/cloud/admin.mjs @@ -90,6 +90,13 @@ if (Object.keys(SUBDOMAINS).length) { const html = readFileSync(leaf, 'utf8').replace(/]*)>/i, ``) return new Response(html, { headers: { ...headers, 'content-type': 'text/html; charset=utf-8', 'cache-control': 'no-cache' } }) } + // /embed-test: every web plugin in this host's tree, embedded as JavaScript (deployment/cloud/embed-test.html, + // read per request from the pulled checkout, so the page follows the branch without a restart). + if (url.pathname === '/embed-test' || url.pathname === '/embed-test/') { + const page = '/app/repo/deployment/cloud/embed-test.html' + if (!existsSync(page)) return text('not found', 404) + return new Response(readFileSync(page, 'utf8'), { headers: { ...headers, 'content-type': 'text/html; charset=utf-8', 'cache-control': 'no-cache' } }) + } const f = normalize(join(CDN, decodeURIComponent(url.pathname))) if (!f.startsWith(CDN + '/dx-maps/')) return text('not found', 404) const file = existsSync(f) && statSync(f).isDirectory() ? join(f, 'index.html') : f diff --git a/deployment/cloud/embed-test.html b/deployment/cloud/embed-test.html new file mode 100644 index 000000000..7f5a60972 --- /dev/null +++ b/deployment/cloud/embed-test.html @@ -0,0 +1,134 @@ + + + + + + + +Embed test + + + +

Embed test

+

Reading the manifest…

+
+ + +