https://github.com/liveblocks/zenrouter
An opinionated HTTP router with typed path params, built-in body validation, and a clean auth model.
https://github.com/liveblocks/zenrouter
Last synced: 2 months ago
JSON representation
An opinionated HTTP router with typed path params, built-in body validation, and a clean auth model.
- Host: GitHub
- URL: https://github.com/liveblocks/zenrouter
- Owner: liveblocks
- License: apache-2.0
- Created: 2026-02-25T12:55:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-10T08:34:37.000Z (4 months ago)
- Last Synced: 2026-03-10T15:57:25.782Z (4 months ago)
- Language: TypeScript
- Homepage: https://zenrouter.liveblocks.io
- Size: 1.81 MB
- Stars: 34
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Zen Router
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.
**[Documentation](https://zenrouter.liveblocks.io/docs)**
## Installation
```
npm i @liveblocks/zenrouter
```
## Quick start
```ts
import { object, string } from "decoders";
import { ZenRouter } from "@liveblocks/zenrouter";
const zen = new ZenRouter(/* ... */);
zen.route(
"GET /greet/",
({ 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](https://liveblocks.io).
See [LICENSE](../../licenses/LICENSE-APACHE-2.0) for more information.