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
All of my logic goes in each router
Most of the time it's just db interactions so it's nice and simple
Are you still able to test it outside the router like with Postman?
I'm sure you could since it'll map to an API route eventually, I personally haven't
Sweet, thx