-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix typos and wrong paths in server-routes.md #4461
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
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit e726c37.
☁️ Nx Cloud last updated this comment at |
@@ -26,7 +26,7 @@ export const ServerRoute = createServerFileRoute().methods({ | |||
Because server routes can be defined in the same directory as your app routes, you can even use the same file for both! | |||
|
|||
```tsx | |||
// routes/hello.tsx | |||
// routes/api/hello.tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match
fetch('/api/hello', { |
While both routes/hello.tsx
and routes/api/hello.tsx
are supported now, api/hello
makes more sense api routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, this example explicitly shows how to colocate with render routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server route is at routes/hello.tsx
(/hello
) and the fetch request goes to /api/hello
One of them must change
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-with-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
|
||
```ts | ||
// routes/users/$id.ts | ||
// routes/api/users/$id.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Visit /api/users/123 to see the response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't enforce the /api path anymore so the docs are mostly fine already. no need to add it
I know, but there is a
At the end of every example. One of the file name or the comment needs to be fixed |
No description provided.