-
Notifications
You must be signed in to change notification settings - Fork 0
Home
GitHub Actions edited this page Apr 29, 2026
·
4 revisions
A Node.js framework with one routing model for HTTP and WebSocket.
npm install restnioRestNio is a lightweight Node.js server framework where every route is bimodal by default — the same handler works for HTTP requests and WebSocket messages unless you explicitly opt for one or the other.
- Bimodal routing — HTTP and WebSocket share the same route definitions by default
- Built-in validation — param parsing, type coercion, formatting, and checks in one pass
-
JWT auth — per-route permission lists with path-param substitution (
dogs.feed.:name) -
Plugins —
rnio.serve(),rnio.cors(),rnio.ratelimit()mount as route middleware -
Connectors — outbound
RestNio.request(),RestNio.http,RestNio.websocketclients built in -
TypeScript — ships
.d.tsdeclarations with path-param type inference
| Page | Summary |
|---|---|
| Quick Start | Smallest working server in 10 lines |
| Routing | Bimodal, HTTP-only, WS-only, path params, regex, nested routers |
| Params & Validation | Type coercion, shorthand helpers, checks, formatters |
| Page | Summary |
|---|---|
| HTTP Behavior | Response types, cookies, manual control, headers |
| Auth & Permissions | JWT tokens, token.grant(), cookie auth, permission templates |
| Page | Summary |
|---|---|
| WebSocket Basics | Unified routing model, RPC pattern, push, subscriptions |
| Binary Routing | Named binary routes, upload pattern |
| Codec Negotiation | JSON (default) and MessagePack |
| Page | Summary |
|---|---|
| Plugins | Static files, CORS, rate limiting |
| Default Routes | Override 404 / 403 / 500 / wsConnect / wsBin
|
| Outbound Connectors | HTTP and WebSocket outbound clients |
| Interconnect (S2S) | Persistent peer connections between RestNio servers |
| Page | Summary |
|---|---|
| TypeScript | Declaration files, path-param inference |
| Progressive Starter | Annotated full example to copy and extend |
| Operational Notes | Server options, proxy config, security checklist |
| Testing & Coverage | Test commands and coverage matrix |
Getting started
HTTP
WebSocket
Server features
Reference