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

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

Merged
merged 1 commit into from Aug 16, 2022

Conversation

farnabaz
Copy link
Member

@farnabaz farnabaz commented Aug 16, 2022

πŸ”— 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
Copy link

netlify bot commented Aug 16, 2022

βœ… Deploy Preview for nuxt-content ready!

Name Link
πŸ”¨ Latest commit 5910962
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/62fba473c57fb4000ad55f30
😎 Deploy Preview https://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 pi0 August 16, 2022 14:06
Copy link
Member

@pi0 pi0 left a comment

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 main Aug 16, 2022
@farnabaz farnabaz deleted the fix/add-json-extension branch August 16, 2022 15:01
@farnabaz farnabaz mentioned this pull request Sep 2, 2022
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.

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