-
Notifications
You must be signed in to change notification settings - Fork 27k
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
pass-server-data example: Use API Routes? #8976
Comments
I think the example should be removed, it shows a bunch of bad practices. |
Ah, ok! Can you list these other bad practices out? Maybe these two tasks could be done at the same time? Eg:
|
The goal of the example is showing passing data as the querystring which in general you don't want to do, |
Ok, so if I was to rework the example in the way described in the blog post, this would be acceptable? TLDR version:
|
I guess that might work, but that's already covered here: https://github.com/zeit/next.js/tree/canary/examples/api-routes |
Ok great! Don't need to do anything except remove the Should I open a PR to do this? |
Sure! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Examples bug report
Example name
pass-server-data
Describe the bug
So not as much of a bug as a suggestion of a potential improvement:
The data is currently being
require
d and passed to the pages by a customserver.js
file that uses Express.Would the Next.js team be open to migrating this example to use API Routes? Maybe with an implementation along the lines of React Tricks: Exploring Next.js 9 Dynamic Routing & API Routes?
Alternatives
A potential alternative (which would allow retaining the current version of
pass-server-data
as it is for reference) would be to copy and rename this example to create a new example that did use API Routes.To Reproduce
Not applicable
Expected behavior
Example uses API Routes
System information
Not Applicable
Additional context
The text was updated successfully, but these errors were encountered: