open source is social v-it.org
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2026 sol pbc
3
4import { handleRequest } from './api.js';
5import { streamEvents } from './jetstream.js';
6
7export { CursorStore } from './cursor.js';
8
9export default {
10 async fetch(request, env) {
11 const url = new URL(request.url);
12 if (url.pathname.startsWith('/api/')) {
13 return handleRequest(request, env);
14 }
15
16 return new Response('not found', { status: 404 });
17 },
18
19 async scheduled(event, env, ctx) {
20 // Always live-tail (no cursor) — Jetstream doesn't replay custom lexicon
21 // commits via cursor. D1 UNIQUE constraints handle deduplication.
22 const result = await streamEvents(env, null);
23 },
24};