atproto user agency toolkit for individuals and groups
1import { loadConfig } from "./config.js";
2import { startServer, type ServerHandle } from "./start.js";
3
4const config = loadConfig();
5
6// Register signal handlers BEFORE await so SIGTERM during startup exits cleanly
7let handle: ServerHandle | undefined;
8const shutdown = () => {
9 (handle?.close() ?? Promise.resolve()).finally(() => process.exit(0));
10};
11process.on("SIGINT", shutdown);
12process.on("SIGTERM", shutdown);
13
14handle = await startServer(config);