Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants