Skip to content

Lambda, Deno, Bun, Node

The handler is (req: Request) => Promise<Response>.

ts
import { toLambdaHandler } from '@sealpixel/server/lambda';
export const handler = toLambdaHandler(fetchHandler);
ts
Deno.serve({ port: 8080 }, fetchHandler);
ts
Bun.serve({ port: 8080, fetch: fetchHandler });
ts
import { serve } from 'srvx';
serve({ port: 8080, fetch: fetchHandler });
ts
// astro.config: sealpixel({ renderRoute: true }) injects /api/sealpixel/render

toLambdaHandler accepts API Gateway v2 and Function URL events, and a direct-invoke job shape { source, editLog, output, destination } for SQS or Step Functions. The wasm binary is bundled as an asset; with esbuild use --loader:.wasm=file, or rely on the Node loader's fallback that resolves @sealpixel/wasm/sealpixel_core_bg.wasm from node_modules.

The repository's infra/lambda-demo is an SST v3 stack: one bucket, one 1769 MB function with a Function URL and reserved concurrency as a rate limit.