| import { WebServer } from "./server"; |
| import { DEFAULT_CONFIG } from "./config"; |
|
|
| async function main(): Promise<void> { |
| console.clear(); |
| |
| console.log(` |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| β β |
| β π¬ TikTok Live Studio - Web Interface β |
| β β |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| `); |
|
|
| |
| 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(); |