Skip to content

fix: generate rss.xml file by lowercasing get() function#4678

Merged
sarah11918 merged 2 commits into
withastro:mainfrom
Knorgias:patch-1
Sep 13, 2023
Merged

fix: generate rss.xml file by lowercasing get() function#4678
sarah11918 merged 2 commits into
withastro:mainfrom
Knorgias:patch-1

Conversation

@Knorgias
Copy link
Copy Markdown
Contributor

What kind of changes does this PR include?

  • Minor content fixes (broken links, typos, etc.)
  • Changes to the docs site code

Description

After following the rss-feed blog tutorial I came across an issue.

Issue:
When running npm run build then npm run preview, rss.xml file does not seem to be created, as /rss.xml on local returns a 404.

Potential solution:
This issue was solved after lowercasing GET()

from:
export async function GET() {
to:
export async function get() {

by finding and applying koba-masa's suggestion on Astro discord channel

Following the [rss-feed blog tutorial](https://docs.astro.build/en/tutorial/5-astro-api/4/#install-astros-rss-package)

Issue:
When running `npm run build` then `npm run preview`, rss.xml file does not seem to be created, as /rss.xml on local returns a 404.


Potential solution:
This issue was solved after lowercasing GET()

from:
`export async function GET() {`
to:
`export async function get() {`

by finding and applying [koba-masa's suggestion on Astro discord channel](https://discord.com/channels/830184174198718474/1147825423594565752/1147825423594565752)
@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 13, 2023

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ec51dbc
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/6501c961bef5fb000776a435
😎 Deploy Preview https://deploy-preview-4678--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 configuration.

@sarah11918 sarah11918 added the code snippet update Updates a code sample: typo, outdated code etc. label Sep 13, 2023
Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thanks for this, @Knorgias !

Just to let you know, the underlying problem is that the RSS generating method needs updating for v3.0, which WILL eventually use the capital GET. But you're right, while we continue to have the older instructions from v2.0, it needs to be the lower case get. So don't be surprised if you come back in a few weeks and we've updated this whole page again to use GET, because that is eventually our long term solution!

But so that it works for people until then, this is a great help! 🙌 Welcome to Team Docs! 🥳

@sarah11918 sarah11918 merged commit cbcef87 into withastro:main Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code snippet update Updates a code sample: typo, outdated code etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants