Skip to content

Fix the example code errors in the Endpoints section#3134

Merged
delucis merged 2 commits into
withastro:mainfrom
olcchi:params-and-dynamic-routing
May 2, 2023
Merged

Fix the example code errors in the Endpoints section#3134
delucis merged 2 commits into
withastro:mainfrom
olcchi:params-and-dynamic-routing

Conversation

@olcchi
Copy link
Copy Markdown
Contributor

@olcchi olcchi commented May 1, 2023

What kind of changes does this PR include?

  • Changes to the docs site code

Description

  • I found some issues in the example code in the params and Dynamic routing section while browsing through the documentation. The expected result mentioned in the documentation for the file path src/pages/[id].json.ts and the routes generated by the getStaticPaths() function is “This will generate three JSON endpoints at build time: /api/1.json, /api/2.json, /api/3.json.” However, the actual result generated by the example code is /0.json, /1.json, /2.json.

  • So I modified the file path in the sample code in the document to scr/pages/api/[id].json.ts, and changed the expected generated JSON endpoints in the document to the actual ones that will be produced, namely /api/0.json, /api/1.json, /api/2.json.

  • I found that this part has the same issue in other language versions as well.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 1, 2023

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit faef77d
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/64510905e38387000827dd85
😎 Deploy Preview https://deploy-preview-3134--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Copy Markdown
Member

@ElianCodes ElianCodes left a comment

Choose a reason for hiding this comment

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

I did not technically review this, but this would make sense!

@olcchi olcchi changed the title fix: Fix sample code path error Fix the example code errors in the Endpoints section May 2, 2023
Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks @Ekarmore and for the review @ElianCodes!

@delucis delucis merged commit 33b3229 into withastro:main May 2, 2023
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.

4 participants