trpc-openapi icon indicating copy to clipboard operation
trpc-openapi copied to clipboard

[Question] Why are there two routes in the nextjs example?

Open DevMude opened this issue 1 year ago • 1 comments

In the nextjs example there are two routes:

  1. src/pages/api/[...trpc].ts
  2. src/pages/api/trpc/[...trpc].ts

And I cannot figure out why. Can somebody please explain the purpose of each route and when you would use one over the other?

DevMude avatar May 01 '24 01:05 DevMude

One is the OpenAPI REST route, and the other is the normal tRPC route. They are distinct in the shape of the requests.

jimboboliver avatar Jun 10 '24 04:06 jimboboliver