@<%= it.issue.repository.full_name %>
+<%= it.issue.title %>
+ <% if (it.issue.body) { %> + + <% } %> +diff --git a/server.js b/server.js index 2f776ce..5ce5df5 100644 --- a/server.js +++ b/server.js @@ -41,4 +41,22 @@ app.get('/:owner/:repo', async function (req, res) { res.send(await render(html)) }) +app.get('/:owner/:repo/issues/:num', async function (req, res) { + const issueResp = await fetch( + `https://git.gay/api/v1/repos/${req.params.owner}/${req.params.repo}/issues/${req.params.num}` + ) + const issue = await issueResp.json() + const html = await eta.renderAsync('issue', { + issue, + debug + }) + if (debug) { + res.send(html) + return + } + res.type('png') + res.set('Content-Disposition', 'inline') + res.send(await render(html)) +}) + app.listen(8085) diff --git a/views/issue.eta b/views/issue.eta new file mode 100644 index 0000000..cf2e50e --- /dev/null +++ b/views/issue.eta @@ -0,0 +1,14 @@ +
@<%= it.issue.repository.full_name %>
+<%= it.issue.title %>
+ <% if (it.issue.body) { %> + + <% } %> +