spb/autoscholar
Public
1import { heartbeat } from "@autoscholar/core";2import { HeartbeatRequest } from "@autoscholar/schemas";3import { handler, json, parseBody } from "@/lib/server/api";4import { db } from "@/lib/server/db";5import { requireWorker } from "@/lib/server/internal";67export const runtime = "nodejs";89export const POST = handler(async (req) => {10 const worker = await requireWorker(req);11 const body = await parseBody(req, HeartbeatRequest, 64 * 1024);12 return json(await heartbeat(db(), worker, body));13});14