diff --git a/main.ts b/main.ts index 4c4b1bf..7eec0eb 100644 --- a/main.ts +++ b/main.ts @@ -1,42 +1,38 @@ import { Jetstream } from "@skyware/jetstream"; const jetstream = new Jetstream({ - wantedCollections: [ - "space.litenote.note", - ], + wantedCollections: ["space.litenote.note"], }); jetstream.onCreate("space.litenote.note", (event) => { - const { did, commit } = event - console.log("create", did, commit); - + const { did, commit } = event; + console.log("create", did, commit); }); jetstream.onUpdate("space.litenote.note", (event) => { - const { did, commit } = event - console.log("update", did, commit); + const { did, commit } = event; + console.log("update", did, commit); }); - jetstream.on("close", () => { - console.log("Connection closed, PartySocket will reconnect automatically"); + console.log("Connection closed, PartySocket will reconnect automatically"); }); jetstream.on("error", (error) => { - console.log("Connection closed with error", error); + console.log("Connection closed with error", error); }); -console.log("launching jetstream") +console.log("launching jetstream"); jetstream.start(); // Keep the process alive and provide a health check Bun.serve({ - port: 3000, - routes: { - "/health": () => new Response("ok"), - }, - fetch() { - return new Response("Not Found", { status: 404 }); - }, + port: 3000, + routes: { + "/health": () => new Response("ok"), + }, + fetch() { + return new Response("Not Found", { status: 404 }); + }, });