From 200defaa5c769b4603f9256e943821344cadbe82 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Tue, 27 Jan 2026 15:05:36 -0500 Subject: List issues --- src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 51e8cf2..d4229fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,13 @@ import { type Context, Hono } from "hono"; import type { StatusCode } from "hono/utils/http-status"; import path from "node:path"; import url from "node:url"; -import { getGitHubBlob, getGitHubRepo, getGitHubTree, GitHubHTTPError } from "./scraper.ts"; +import { + getGitHubBlob, + getGitHubIssues, + getGitHubRepo, + getGitHubTree, + GitHubHTTPError, +} from "./scraper.ts"; const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); @@ -56,6 +62,11 @@ app.get("/:owner/:repo/raw/:branch/:path{.*}", async (c) => { return c.redirect(`https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`); }); +app.get("/:owner/:repo/issues", async (c) => { + const { owner, repo } = c.req.param(); + return tryRender(c, "issues.eta", getGitHubIssues(owner, repo)); +}); + app.all("*", async (c) => { const path = c.req.path; c.header("Referrer-Policy", "no-referrer"); -- cgit v1.3.1