Actually paginate leaderboards
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user