diff --git a/server/index.ts b/server/index.ts index 4d607eb..8c7c0a1 100644 --- a/server/index.ts +++ b/server/index.ts @@ -63,7 +63,7 @@ import { dataModule } from "../modules/data/mod"; import { splatModule } from "../modules/splat/mod"; import { photosModule } from "../modules/photos/mod"; import { spaces } from "./spaces"; -import { renderShell, renderModuleLanding } from "./shell"; +import { renderShell } from "./shell"; import { syncServer } from "./sync-instance"; import { loadAllDocs } from "./local-first/doc-persistence"; @@ -778,29 +778,15 @@ const server = Bun.serve({ return app.fetch(rewrittenReq); } - // ── Bare-domain module routes: rspace.online/{moduleId} ── - // Exact module path → embed standalone domain in iframe (avoids CORS). - // Sub-paths (API, assets) → rewrite to /demo/{moduleId}/... for backward compat. + // ── Bare-domain module routes: rspace.online/{moduleId}[/...] ── + // Rewrite to /demo/{moduleId}/... so the normal shell renders identically + // to how standalone domains (e.g. rtube.online) serve their content. if (!subdomain && hostClean.includes("rspace.online")) { const pathSegments = url.pathname.split("/").filter(Boolean); if (pathSegments.length >= 1) { const firstSegment = pathSegments[0]; const knownModuleIds = new Set(getAllModules().map((m) => m.id)); if (knownModuleIds.has(firstSegment)) { - // Exact module path → landing page with iframe embed - if (pathSegments.length === 1) { - const modInfo = getModuleInfoList().find((m) => m.id === firstSegment); - if (modInfo) { - return new Response( - renderModuleLanding({ - module: modInfo, - modules: getModuleInfoList(), - }), - { headers: { "Content-Type": "text/html; charset=utf-8" } }, - ); - } - } - // Sub-paths → rewrite to demo space const rewrittenPath = `/demo${url.pathname}`; const rewrittenUrl = new URL(rewrittenPath + url.search, `http://localhost:${PORT}`); const rewrittenReq = new Request(rewrittenUrl, req);