aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-01-27 15:05:36 -0500
committerJoe Mou <dev@mou.fo>2026-01-27 17:21:45 -0500
commit200defaa5c769b4603f9256e943821344cadbe82 (patch)
treec66bc43948d8accf8cd2d5462c6115c8cc238ca7 /src/index.ts
parent8fec0b99fbe193326d25fc107e0c625dcf05fd12 (diff)
List issues
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts13
1 files changed, 12 insertions, 1 deletions
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");