mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat: reader-compat batch — JSON Feed, OPML export, conditional GET, dedup
Batch of four reader-facing improvements (TODO "Compat lecteurs + dedup"): - JSON Feed at /json/:feedId (feed lib .json1()); all formats cross-link - OPML export at /admin/opml (admin-protected; the registry lists every feed URL, so it must not be public) - Conditional GET on /rss + /atom: strong ETag + Last-Modified, 304 on If-None-Match/If-Modified-Since, validators shared via http-cache.ts - Duplicate-send dedup in ingestion: match by Message-ID, fall back to a SHA-256 of normalized subject+content; a duplicate is a no-op and bumps the new emails_deduplicated counter (status page + /api/v1/stats) 429 tests green, tsc clean, build dry-run OK. Docs (README/CLAUDE/TODO + landing cards) updated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { cors } from "hono/cors";
|
||||
import { handle as handleInbound } from "./routes/inbound";
|
||||
import { handle as handleRSS } from "./routes/rss";
|
||||
import { handle as handleAtom } from "./routes/atom";
|
||||
import { handle as handleJSON } from "./routes/json";
|
||||
import { handle as handleAdmin } from "./routes/admin";
|
||||
import { handle as handleEntry } from "./routes/entries";
|
||||
import { handle as handleFiles } from "./routes/files";
|
||||
@@ -116,6 +117,7 @@ app.use(
|
||||
const api = new Hono<AppEnv>();
|
||||
const rss = new Hono<AppEnv>();
|
||||
const atom = new Hono<AppEnv>();
|
||||
const json = new Hono<AppEnv>();
|
||||
const entries = new Hono<AppEnv>();
|
||||
const files = new Hono<AppEnv>();
|
||||
const admin = new Hono<AppEnv>();
|
||||
@@ -151,6 +153,9 @@ rss.get("/:feedId", handleRSS);
|
||||
// Atom feed routes (public)
|
||||
atom.get("/:feedId", handleAtom);
|
||||
|
||||
// JSON Feed routes (public)
|
||||
json.get("/:feedId", handleJSON);
|
||||
|
||||
// Email entry HTML view (public)
|
||||
entries.get("/:feedId/:entryId", handleEntry);
|
||||
|
||||
@@ -166,6 +171,7 @@ app.route("/api", api);
|
||||
app.route("/api", apiApp);
|
||||
app.route("/rss", rss);
|
||||
app.route("/atom", atom);
|
||||
app.route("/json", json);
|
||||
app.route("/entries", entries);
|
||||
app.route("/files", files);
|
||||
app.route("/admin", admin);
|
||||
|
||||
Reference in New Issue
Block a user