mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-21 06:13:48 +00:00
refactor: extract url helpers, add EMAIL_DOMAIN support
- Add src/utils/urls.ts with baseUrl, feedRssUrl, feedAtomUrl, feedUrl, feedEmailAddress, feedTopicPattern - Add optional EMAIL_DOMAIN env var so web domain and email domain can differ (e.g. demo.kill-the.news serves feeds, @kill-the.news receives mail) - Replace all inline domain template literals with the new helpers - Remove unused site_url/feed_url fields from FeedConfig - Remove unused feedPath param from fetchFeedData - Extract verifyCallback() to deduplicate verifyAndStoreSubscription / verifyAndDeleteSubscription Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,6 @@ export interface FeedData {
|
||||
export async function fetchFeedData(
|
||||
feedId: string,
|
||||
env: Env,
|
||||
feedPath: "rss" | "atom",
|
||||
): Promise<FeedData | null> {
|
||||
const storage = env.EMAIL_STORAGE;
|
||||
|
||||
@@ -26,8 +25,6 @@ export async function fetchFeedData(
|
||||
)) as FeedConfig | null) ?? {
|
||||
title: `Newsletter Feed ${feedId}`,
|
||||
description: "Converted email newsletter",
|
||||
site_url: `https://${env.DOMAIN}/${feedPath}/${feedId}`,
|
||||
feed_url: `https://${env.DOMAIN}/${feedPath}/${feedId}`,
|
||||
language: "en",
|
||||
created_at: Date.now(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user