WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
at user-theme-preferences 21 lines 659 B view raw
1import type { LogLevel } from "@atbb/logger"; 2 3export interface WebConfig { 4 port: number; 5 appviewUrl: string; 6 logLevel: LogLevel; 7 /** In-memory theme cache TTL in milliseconds. Defaults to 5 minutes. */ 8 themeCacheTtlMs: number; 9} 10 11export function loadConfig(): WebConfig { 12 return { 13 port: parseInt(process.env.WEB_PORT ?? "3001", 10), 14 appviewUrl: process.env.APPVIEW_URL ?? "http://localhost:3000", 15 logLevel: (process.env.LOG_LEVEL as LogLevel) ?? "info", 16 themeCacheTtlMs: (() => { 17 const parsed = parseInt(process.env.THEME_CACHE_TTL_MS ?? "300000", 10); 18 return Number.isNaN(parsed) ? 300_000 : parsed; 19 })(), 20 }; 21}