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

Api params #29

Merged
merged 4 commits into from
May 16, 2021
Merged

Api params #29

merged 4 commits into from
May 16, 2021

Conversation

frandiox
Copy link
Owner

@frandiox frandiox commented May 15, 2021

Closes #28


Dynamic routes (e.g. `/api/users/:id`) can be specified by using brackets in file or directory names as follows:

- Required parameter: Single brackets `<root>/functions/api/users/[id].js`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting one! I actually came to raise a ticket right now 🙈 something similar. But then I saw one open PR, so thought let me look at what you been cooking 😝

I am seeing an issue with the dynamic route workaround I had implemented (If you dont remember, just in case #L4).

Nested routes not able to fetch defineEdgeProps. I have defined the a folder same as the route in the functions for props.

So would this fix this issue too?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbgse No, this is only for the api folder. The props don't have URL parameters since they rely just on the route name.

Nested routes not able to fetch defineEdgeProps
Can you try to assign a simple name to those routes? Like name: 'projects', and then create a functions/props/projects.js file?

Also, try to check dist/functions.js and see if the exported object has the correct names and paths.

@frandiox frandiox merged commit 4b76a07 into master May 16, 2021
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

Successfully merging this pull request may close these issues.

API parameters
2 participants