summaryrefslogtreecommitdiff
path: root/cgithub/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cgithub/src/index.ts')
-rw-r--r--cgithub/src/index.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/cgithub/src/index.ts b/cgithub/src/index.ts
index 51e8cf2..d4229fd 100644
--- a/cgithub/src/index.ts
+++ b/cgithub/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");