Skip to content

@oona/vlo / host / handler

Function: handler() ​

handler(options): object

Defined in: sdk/ts/sdk/src/host/roles.ts:341

Next route file: export const { GET, POST } = handler({ … }). The host is created on the first request and shared by every request after, so a serverless function pays for the kernel load once per instance. Pair it with dispatcher: { mode: "manual" } and a cron on POST /v1/timers/tick.

Parameters ​

options ​

CreateHostOptions

Returns ​

object

GET ​

GET: FetchHandler

POST ​

POST: FetchHandler

Example ​

ts
// app/api/vlo/[[...path]]/route.ts
import { handler } from "@oona/vlo/host";

export const { GET, POST } = handler({
  journal: process.env.DATABASE_URL ?? "sqlite://./.vlo/dev.db",
  workflows: [pipeline],
  activities: [render],
  basePath: "/api/vlo",
  dispatcher: { mode: "manual" },
});