this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Cosmetics, tweak defaults

alice e58bf730 34a601eb

+17 -19
+5 -10
src/index.ts
··· 9 9 10 10 dotenv.config(); 11 11 12 - // Configuration 13 - const FIREHOSE_URL = process.env.FIREHOSE_URL || 'ws://localhost:8080'; // Pointing to mock server for testing 14 - const PORT = parseInt(process.env.PORT || '3000', 10); 15 - const WANTED_COLLECTIONS = process.env.WANTED_COLLECTIONS 16 - ? process.env.WANTED_COLLECTIONS.split(',') 17 - : ['app.bsky.feed.post']; 18 - const PURGE_DAYS = parseInt(process.env.PURGE_DAYS || '7', 10); 19 - const RECONNECT_DELAY_MS = 1000; // Initial reconnect delay in ms 20 - const CURSOR_UPDATE_INTERVAL_MS = 10 * 1000; // 10 seconds 12 + const FIREHOSE_URL = process.env.FIREHOSE_URL ?? 'wss://jetstream.atproto.tools/subscribe'; // default to Jaz's Jetstream instance 13 + const PORT = parseInt(process.env.PORT ?? '9201', 10); 14 + const WANTED_COLLECTIONS = process.env.WANTED_COLLECTIONS?.split(',') ?? ['app.bsky.feed.post']; 15 + const RECONNECT_DELAY_MS = 1000; 16 + const CURSOR_UPDATE_INTERVAL_MS = 10 * 1000; 21 17 22 - // Validate Environment Variables 23 18 if (!FIREHOSE_URL) { 24 19 logger.error('FIREHOSE_URL is not defined in the environment variables.'); 25 20 process.exit(1);
+12 -9
src/logger.ts
··· 1 1 import pino from 'pino'; 2 2 3 3 const logger = pino({ 4 - level: process.env.LOG_LEVEL || 'info', 5 - transport: process.env.NODE_ENV !== 'production' ? { 6 - target: 'pino-pretty', 7 - options: { 8 - colorize: true, 9 - translateTime: 'SYS:standard', 10 - ignore: 'pid,hostname', 11 - }, 12 - } : undefined, 4 + level: process.env.LOG_LEVEL ?? 'info', 5 + transport: 6 + process.env.NODE_ENV !== 'production' ? 7 + { 8 + target: 'pino-pretty', 9 + options: { 10 + colorize: true, 11 + translateTime: 'SYS:standard', 12 + ignore: 'pid,hostname', 13 + }, 14 + } 15 + : undefined, 13 16 timestamp: pino.stdTimeFunctions.isoTime, 14 17 }); 15 18