fix(rmeets): use subdomain-aware URLs everywhere
All internal rMeets links were hardcoded to /{space}/rmeets, so clicking
Quick Meet on https://demo.rspace.online/rmeets landed on
https://demo.rspace.online/demo/rmeets/<id> — a banned path-with-subdomain
URL. Added rmeetsBase(c) that returns /rmeets on {space}.rspace.online and
/{space}/rmeets elsewhere; swept all five `base` sites plus the inline
meeting page's meetsBase.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
dd608f831c
commit
e3f322e7ff
|
|
@ -38,6 +38,13 @@ const MI_API_URL = process.env.MEETING_INTELLIGENCE_API_URL || "http://meeting-i
|
||||||
const MI_INTERNAL_KEY = process.env.MI_INTERNAL_KEY || "";
|
const MI_INTERNAL_KEY = process.env.MI_INTERNAL_KEY || "";
|
||||||
const routes = new Hono();
|
const routes = new Hono();
|
||||||
|
|
||||||
|
// Subdomain-aware base for this module: `/rmeets` on {space}.rspace.online,
|
||||||
|
// `/{space}/rmeets` on localhost or bare domain.
|
||||||
|
function rmeetsBase(c: any): string {
|
||||||
|
const space = c.req.param("space") || "demo";
|
||||||
|
return c.get("isSubdomain") ? "/rmeets" : `/${escapeHtml(space)}/rmeets`;
|
||||||
|
}
|
||||||
|
|
||||||
// ── Meeting Intelligence API helper ──
|
// ── Meeting Intelligence API helper ──
|
||||||
|
|
||||||
async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> {
|
async function miApiFetch(path: string, options?: { method?: string; body?: any }): Promise<{ ok: boolean; data?: any; error?: string }> {
|
||||||
|
|
@ -184,7 +191,7 @@ routes.get("/meet", (c) => {
|
||||||
|
|
||||||
routes.get("/recordings", async (c) => {
|
routes.get("/recordings", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const prefix = encodeURIComponent(space + "_");
|
const prefix = encodeURIComponent(space + "_");
|
||||||
const result = await miApiFetch(`/meetings?limit=50&sort=-created_at&conference_prefix=${prefix}`);
|
const result = await miApiFetch(`/meetings?limit=50&sort=-created_at&conference_prefix=${prefix}`);
|
||||||
|
|
||||||
|
|
@ -240,7 +247,7 @@ routes.get("/recordings/:id", (c) => {
|
||||||
|
|
||||||
routes.get("/recordings/:id/:tab", async (c) => {
|
routes.get("/recordings/:id/:tab", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const id = c.req.param("id");
|
const id = c.req.param("id");
|
||||||
const tab = c.req.param("tab") || "overview";
|
const tab = c.req.param("tab") || "overview";
|
||||||
const validTabs = ["overview", "transcript", "summary", "speakers"];
|
const validTabs = ["overview", "transcript", "summary", "speakers"];
|
||||||
|
|
@ -365,7 +372,7 @@ ${speakerList}`;
|
||||||
|
|
||||||
routes.get("/search", async (c) => {
|
routes.get("/search", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const q = c.req.query("q") || "";
|
const q = c.req.query("q") || "";
|
||||||
|
|
||||||
let resultsHtml = "";
|
let resultsHtml = "";
|
||||||
|
|
@ -445,7 +452,7 @@ routes.all("/api/mi-proxy/*", async (c) => {
|
||||||
|
|
||||||
routes.get("/", (c) => {
|
routes.get("/", (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const randomId = Math.random().toString(36).slice(2, 10);
|
const randomId = Math.random().toString(36).slice(2, 10);
|
||||||
return c.html(renderShell({
|
return c.html(renderShell({
|
||||||
title: `rMeets — ${space} | rSpace`,
|
title: `rMeets — ${space} | rSpace`,
|
||||||
|
|
@ -526,7 +533,7 @@ routes.get("/", (c) => {
|
||||||
|
|
||||||
routes.get("/meeting-intelligence", async (c) => {
|
routes.get("/meeting-intelligence", async (c) => {
|
||||||
const space = c.req.param("space") || "demo";
|
const space = c.req.param("space") || "demo";
|
||||||
const base = `/${escapeHtml(space)}/rmeets`;
|
const base = rmeetsBase(c);
|
||||||
const prefix = encodeURIComponent(space + "_");
|
const prefix = encodeURIComponent(space + "_");
|
||||||
|
|
||||||
// Fetch space-scoped meetings from MI API
|
// Fetch space-scoped meetings from MI API
|
||||||
|
|
@ -674,7 +681,7 @@ routes.get("/:room", (c) => {
|
||||||
|
|
||||||
// Default: clean full-screen Jitsi — no rSpace shell, mobile-friendly
|
// Default: clean full-screen Jitsi — no rSpace shell, mobile-friendly
|
||||||
const jitsiRoom = encodeURIComponent(space + "_" + room);
|
const jitsiRoom = encodeURIComponent(space + "_" + room);
|
||||||
const meetsBase = `/${escapeHtml(space)}/rmeets`;
|
const meetsBase = rmeetsBase(c);
|
||||||
return c.html(`<!DOCTYPE html>
|
return c.html(`<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue