t
tRPC
t
tRPC
Router Middleware
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
A
Alex / KATT 🐱
•
9/21/22, 7:52 PM
in v10
, you add middlewares on procedures and not on routers
N
Nick
•
1/22/23, 9:03 AM
const p
= myStupidlyLongBaseProcedureNameWithLotsOfFunctionality
router
(
{
create
: p
…
,
update
: p
…
}
)
N
Nick
•
1/22/23, 9:06 AM
It
’s clean this way because you
’re not forced into consuming the Context modifications and guards of a middleware even if you have a single procedure which doesn
’t need them
. You can have a few base procedures and mix and match
.