NextJS + tRPC API Logic Question

Are you guys putting your logic for your API routes in separate tRPC router and not making a file in the api directory? Or are you guys defining your API logic in files in the api directory and then also making a router file to define the typesafe inputs/outputs?
4 Replies
Pod
Pod2y ago
All of my logic goes in each router Most of the time it's just db interactions so it's nice and simple
Vengeance
Vengeance2y ago
Are you still able to test it outside the router like with Postman?
Pod
Pod2y ago
I'm sure you could since it'll map to an API route eventually, I personally haven't
Vengeance
Vengeance2y ago
Sweet, thx
Want results from more Discord servers?
Add your server