diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-27 15:05:36 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-27 17:21:45 -0500 |
| commit | d29bdad2f5c8326d111901373f0a56b3a09a2cd8 (patch) | |
| tree | a34128312316849e257bde7750c2e01180a77f3c /cgithub/src/index.ts | |
| parent | 64c397e256b01a2e542e84529e947e237c07edd6 (diff) | |
List issues
Diffstat (limited to 'cgithub/src/index.ts')
| -rw-r--r-- | cgithub/src/index.ts | 13 |
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"); |
