// author: simon-pierre boucher import { buildApp } from "./app.js"; const PORT = Number(process.env["PORT"] ?? 3000); const HOST = process.env["HOST"] ?? "127.0.0.1"; const app = buildApp(); for (const signal of ["SIGINT", "SIGTERM"] as const) { process.on(signal, () => { app.log.info({ signal }, "shutting down"); app.close().then( () => process.exit(0), () => process.exit(1), ); }); } app .listen({ port: PORT, host: HOST }) .then((address) => { app.log.info({ address }, "tendril api listening"); }) .catch((error: unknown) => { app.log.error({ err: error }, "failed to start"); process.exit(1); });