@axion-io/nextjs
v0.0.1
Published
App Router route-handler helpers for Axion applications on NextJS.
Readme
@axion-io/nextjs
NextJS App Router helpers for Axion HTTP routes.
The package works with Web Request and Response objects so route handlers can be tested without booting a NextJS server.
import { createOperationReadinessRoute } from "@axion-io/nextjs";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export const GET = createOperationReadinessRoute({ operationManager });For Axion deployments using the current PostgreSQL and Redis packages, runtime = "nodejs" is the recommended default. Edge runtime is out of scope unless the application supplies Edge-compatible database and wake-up clients.
Exports
extractAxionRouteContextjsonResponseerrorResponsecreateMutationRoutecreateQueryRoutecreateOperationReadinessRoutecreateOperationReadinessStreamRouteoperationReadinessStream
Route helpers read x-tenant-id and x-actor-id headers consistently with the existing HTTP examples. SSE responses use text/event-stream, disable caching and buffering, emit heartbeat comments, and close on terminal readiness states.
