TimKleier
TimKleier
TtRPC
Created by TimKleier on 10/25/2024 in #❓-help
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')
});
2 replies