Features
Webroutes have many features and benefits, compared to using a web framework or writing raw request handlers. It sits somewhere between the two.
Declarative
Define route information declaratively, not imperatively. This encourages setting API boundaries and makes composition and introspection easier.
Composable
Compose previously declared middleware, paths or schema to produce powerful endpoints, without having to repeat yourself.
Atomic
Each route is complete, standalone and router agnostic. Upstream operations like middleware are always traceable at the code level and baked in. Your route can now be used with any framework or runtime that uses web-standards.
The WinterCG web standard is supported by Vercel, Cloudflare, Bun, Deno and many others.
Validation-first
Webroutes encourage input and output validation and provide a first class interface. Use any validation library you want. Since you've defined these schema up-front, producing things like OpenAPI specs becomes a piece of cake.
Future-proof
Built on web-standards, webroute
s don't do anything funky, opaque or complex. It is complex enough to want to avoid rewriting for each app, but simple enough to not feel to magical (and brittle).
Immutable
webroute
s prioritise immutabability, never mutating request or response objects, nor monkey-patching any APIs. The boundaries for extra functionality are explicit and never crossed.
Flexible
Webroutes work with your existing stack. And they'll still work without them.
Like validation libraries...
Nextjs...
Bun...
Deno...
Node...
And many more...
Find out how to achieve routing in Routing