Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/web/src/app/leaderboard.json/route.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { leaderboard } from '../../lib/leaderboard.js';

/**
* The board index, at `/leaderboard.json`.
*
* A route of its own because Next matches on path segments: `/leaderboard.json`
* is a sibling of `/leaderboard`, not a child, so the catch-all under
* `leaderboard/[[...path]]` never sees it and the request falls through to the
* feed route, which answers "no such feed: leaderboard". The package documents
* this path as the index, and on a framework that hands every path to one
* handler it is the index; here it has to be spelled out.
*/
export const dynamic = 'force-dynamic';

export async function GET(request) {
return (await leaderboard().handle(request)) ?? new Response('Not found', { status: 404 });
}

export const HEAD = GET;
Loading