@tschk/moonshine-server
v0.4.1
Published
Web-standard request pipeline: middleware, loaders, actions, error boundaries, and static files.
Readme
@tschk/moonshine-server
Web-standard request pipeline: middleware, loaders, actions, error boundaries, and static files.
import { createRequestHandler } from "@tschk/moonshine-server";
const fetch = createRequestHandler({
manifest,
modules,
renderer: reactRenderer,
staticDir: "./.moonshine",
});
Bun.serve({ fetch });Features:
createRequestHandlermatches routes and runs the full pipeline.- Loaders and actions receive
RouteContextwithrequest,params,signal, anddata. redirect,json,errorResponsehelpers.serializeDataescapes HTML-sensitive characters and rejects cycles.resolveStaticPath/tryServeStaticfor static file serving.
See docs/ROUTING.md and DESIGN.md.
