Skip to content

fix(prerender): add extension to prerendered queries - #1456

Merged
farnabaz merged 1 commit into
mainfrom
fix/add-json-extension
Aug 16, 2022
Merged

fix(prerender): add extension to prerendered queries#1456
farnabaz merged 1 commit into
mainfrom
fix/add-json-extension

Conversation

@farnabaz

@farnabazfarnabaz commented Aug 16, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves#1454
resolves#1281

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Add .json extension to pre-rendered queries.
The issue here is that npx serve with -s option, redirects all URLs (without extension) to index.html and therefore serving generated websites with nuxi preview return 404 for API routes.

In current state, npx nuxi preview and npx serve -s .output/public does not work and only npx serve .output/public works properly.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify

netlifyBot commented Aug 16, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt-content ready!

NameLink
🔨 Latest commit5910962
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt-content/deploys/62fba473c57fb4000ad55f30
😎 Deploy Previewhttps://deploy-preview-1456--nuxt-content.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.

@farnabaz
farnabaz requested a review from pi0August 16, 2022 14:06
pi0
pi0 approved these changes Aug 16, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍🏼 Nitro should handle custom extensions. Only please double check if it does grab those URLs to prerender.

@farnabaz
farnabaz merged commit 57ab0af into mainAug 16, 2022
@farnabaz
farnabaz deleted the fix/add-json-extension branch August 16, 2022 15:01
@farnabazfarnabaz mentioned this pull request Sep 2, 2022
Sign up for freeto 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.

Content 2 and SSG - Problem with ContentList or wrong configuration? Content is not loaded after generate

3 participants

@farnabaz@atinux@pi0