Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: update nested router example #10115

Merged
merged 3 commits into from
Jan 16, 2023
Merged

docs: update nested router example #10115

merged 3 commits into from
Jan 16, 2023

Conversation

FenLiaoYu
Copy link
Contributor

@FenLiaoYu FenLiaoYu commented Jan 16, 2023

πŸ”— Linked issue

nuxt/nuxt#13696

❓ 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

Use eventHandler() to wrap the route handler

In the latest release of h3, we should use eventHandler to wrap our handlers.
https://github.com/unjs/h3/releases/tag/v0.8.0

Fix error: Invalid lazy handler result. It should be a function

We should return a handler function, not a Router, use router.handler or useBase can fix it.
In this case, I think it should be useBase('/api', router.handler)

πŸ“ Checklist

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

@codesandbox
Copy link

codesandbox bot commented Jan 16, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@FenLiaoYu FenLiaoYu changed the title Fix the description of Using a Nested Router docs: fix the description of Using a Nested Router Jan 16, 2023
@atinux atinux requested a review from danielroe January 16, 2023 16:01
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Thanks!

@danielroe danielroe changed the title docs: fix the description of Using a Nested Router docs: update nested router example Jan 16, 2023
@danielroe danielroe merged commit 8892ccc into nuxt:main Jan 16, 2023
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 2023
danielroe pushed a commit that referenced this pull request Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants