Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

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

Open
DevMude opened this issue May 1, 2024 · 1 comment
Open

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

DevMude opened this issue May 1, 2024 · 1 comment

Comments

@DevMude
Copy link

DevMude commented May 1, 2024

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?

@jimboboliver
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants