managarten/services/news-ingester/src/config.ts
Till JS 9ef97a1877 feat(news): backend ingester service + curated feed API
Adds the services/news-ingester Bun service that pulls 25 public RSS/JSON
feeds into news.curated_articles every 15 min, with Mozilla Readability
fallback for thin RSS bodies and 30-day retention. apps/api /feed is
rewritten to read from the new pool table directly instead of the
sync_changes hack, with topics/lang/since/limit/offset query params.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 15:53:26 +02:00

21 lines
622 B
TypeScript

/**
* Environment-driven config. Defaults match the local dev setup
* (`pnpm setup:env` writes the same DATABASE_URL into .env files).
*/
export interface Config {
port: number;
databaseUrl: string;
tickIntervalMs: number;
runOnStartup: boolean;
}
export function loadConfig(): Config {
return {
port: parseInt(process.env.PORT || '3066', 10),
databaseUrl:
process.env.DATABASE_URL || 'postgresql://mana:devpassword@localhost:5432/mana_platform',
tickIntervalMs: parseInt(process.env.TICK_INTERVAL_MS || '900000', 10), // 15 min
runOnStartup: (process.env.RUN_ON_STARTUP || 'true') !== 'false',
};
}