Router
A powerful way to organize procedures with enhanced developer experience.
Introduction
A router is a collection of procedures with utilities that help reduce code duplication and improve organization.
All router functionality is fully typed and begins with the orpc
instance, providing a consistent and intuitive API.
Key Features
Prefixing Routes
You can add a prefix to all routes in a router:
Middleware Application
Apply middleware to all procedures in a router:
Nested Routers
Create hierarchical route structures:
Infer Router Inputs and Outputs
The InferRouterInputs
and InferRouterOutputs
type utilities can be used to infer the input and output types of a router, respectively.