Zenrouter
An opinionated HTTP router with typed path params, built-in body validation, and a clean auth model.
Install / Use
/learn @liveblocks/ZenrouterREADME
Zen Router
<p> <a href="https://npmjs.org/package/@liveblocks/zenrouter"><img src="https://img.shields.io/npm/v/@liveblocks/zenrouter?style=flat&label=npm&color=c33" alt="NPM" /></a> <a href="https://bundlejs.com/?q=%40liveblocks%2Fzenrouter%401.0.17&treeshake=%5B%7B+ZenRouter+%7D%5D"><img src="https://deno.bundlejs.com/badge?q=@liveblocks/zenrouter&treeshake=[{ZenRouter}]" /></a> <a href="https://github.com/liveblocks/zenrouter/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-apache2-green" alt="License: Apache 2.0" /></a> </p>An opinionated API router with typed path params, built-in body validation, and a clean auth model. Built for Cloudflare Workers, Bun, Node.js, and every other modern JavaScript runtime.
Installation
npm i @liveblocks/zenrouter
Quick start
import { object, string } from "decoders";
import { ZenRouter } from "@liveblocks/zenrouter";
const zen = new ZenRouter(/* ... */);
zen.route(
"GET /greet/<name>",
({ p }) => ({ result: `Hi, ${p.name}!` })
);
zen.route(
"POST /greet",
object({ name: string }),
({ body }) => ({
result: `Hi, ${body.name}!`,
})
);
export default zen;
License
Licensed under the Apache License 2.0, Copyright © 2021-present Liveblocks.
See LICENSE for more information.
Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
