Skip to content

feat(handlers): allow method suffix in handler file path#252

Closed
huang-julien wants to merge 1 commit intonitrojs:mainfrom
huang-julien:feat/handler-method-suffix
Closed

feat(handlers): allow method suffix in handler file path#252
huang-julien wants to merge 1 commit intonitrojs:mainfrom
huang-julien:feat/handler-method-suffix

Conversation

@huang-julien
Copy link
Copy Markdown
Contributor

@huang-julien huang-julien commented May 19, 2022

🔗 Linked issue

resolve nuxt/nuxt#14003

❓ 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

Enhance the server handlers.
Allow (if the method is not specified) to use the method suffix as the handler's route method

📝 Checklist

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

@pi0
Copy link
Copy Markdown
Member

pi0 commented Jun 12, 2022

Thanks for this pull request @huang-julien (and sorry to check late!). I think we could directly add this to nuxt kit addServerHandler. Nitro automatically uses this suffix but only for discovered files. Seems too much magic to me for options. We can first try to do this on nuxt kit and and useful enough backport as nitro behavior. (and if we do, we can do the normalization in single place of src/config.ts).

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.

[Kit] Support the method suffix in addServerHandler

2 participants