TimKleier
TimKleier2w ago

Any guidance on adding middleware at the router level?

I want to apply middleware across all admin routes. I could add middleware to the adminProcedure, but I'd prefer to do so at the router level. I didn't see any info in the docs. How can I accomplish this?
const adminRouter = router({
secretPlace: adminProcedure.query(() => 'a key'),
secretPlace2: adminProcedure.query(() => 'b key')
});
const adminRouter = router({
secretPlace: adminProcedure.query(() => 'a key'),
secretPlace2: adminProcedure.query(() => 'b key')
});
0 Replies
No replies yetBe the first to reply to this messageJoin