Actually paginate leaderboards

This commit is contained in:
pleb
2026-04-11 19:16:54 -07:00
parent 8ed38d05a7
commit 9dbd17eb49
7 changed files with 1272 additions and 417 deletions
+13
View File
@@ -75,6 +75,18 @@ function isChatRequestFilename(pathname: string): boolean {
Deno.serve({ port, hostname: "127.0.0.1" }, async (req) => {
const url = new URL(req.url);
if (req.method === "POST" && url.pathname === "/api/overlay-log") {
try {
const raw = await req.text();
const parsed = JSON.parse(raw) as { scope?: string; phase?: string; detail?: unknown };
const scope = typeof parsed.scope === "string" ? parsed.scope : "?";
const phase = typeof parsed.phase === "string" ? parsed.phase : "?";
console.log(`[overlay] ${scope}:${phase}`, parsed.detail ?? "");
} catch {
console.log("[overlay] overlay-log: invalid JSON body");
}
return new Response(null, { status: 204 });
}
if (req.method === "GET" && url.pathname === "/api/beatleader") {
return proxyApiRequest(req, "https://api.beatleader.com");
}
@@ -105,6 +117,7 @@ Deno.serve({ port, hostname: "127.0.0.1" }, async (req) => {
});
console.log(`Overlay: http://127.0.0.1:${port}/index.html`);
console.log("Friend/BeatLeader diagnostics from the page also print here (browser console has the same lines).");
if (chatRequestDatabase) {
console.log(`Chat request database file: ${chatRequestDatabase}`);
} else {