import { WebServer } from "./server"; import { DEFAULT_CONFIG } from "./config"; async function main(): Promise { console.clear(); // Fixed ASCII Art alignment console.log(` ╔═══════════════════════════════════════════════════════════╗ ║ ║ ║ 🎬 TikTok Live Studio - Web Interface ║ ║ ║ ╚═══════════════════════════════════════════════════════════╝ `); // Load default config const config = { ...DEFAULT_CONFIG }; const server = new WebServer(config); const onSigint = (): void => { console.log("\n\n🛑 Shutting down server..."); server.getManager().stopAll(); console.log("✅ All downloads stopped"); process.exit(0); }; process.on("SIGINT", onSigint); process.on("SIGTERM", onSigint); try { await server.start(3000); await new Promise(() => {}); } catch (err) { console.error("❌ Server error:", err); process.exitCode = 1; } } main();