From 14ffee41018de85503cb6832fc371d39d4827716 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 16 Apr 2026 16:21:19 -0400 Subject: [PATCH] fix(rpast): serve interactive viewer at space root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `GET /` to rpast routes. Without it, /rpast on a space subdomain 404'd because the sub-app had no root handler. Now matches the rNotes pattern: bare domain → marketing landing, in-space URL → app shell with . --- modules/rpast/mod.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/rpast/mod.ts b/modules/rpast/mod.ts index 4dc5c99b..5f9ed72a 100644 --- a/modules/rpast/mod.ts +++ b/modules/rpast/mod.ts @@ -12,11 +12,30 @@ import { enumerateCreations, listCreationEnumerators, renderMarkwhen, } from '../../shared/markwhen'; import { renderMarkwhenHtml } from '../../shared/markwhen/html-render'; +import { renderShell } from '../../server/shell'; +import { getModuleInfoList } from '../../shared/module'; import { pastSchema } from './schemas'; import { renderLanding } from './landing'; const routes = new Hono(); +// GET / — marketing landing on bare domain, interactive viewer in a space. +routes.get('/', c => { + const space = c.req.param('space') || 'demo'; + if (!space || space === 'rpast.online') { + return c.html(renderLanding()); + } + return c.html(renderShell({ + title: `${space} — rPast | rSpace`, + moduleId: 'rpast', + spaceSlug: space, + modules: getModuleInfoList(), + theme: 'dark', + body: ``, + scripts: ``, + })); +}); + routes.get('/api/modules', c => { return c.json(listCreationEnumerators().map(e => ({ module: e.module, label: e.label, icon: e.icon, color: e.color,