Skip to content

Conversation

@farnabaz
Copy link
Collaborator

No description provided.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 28, 2024

Deploying nuxthub-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99bd585
Status: ✅  Deploy successful!
Preview URL: https://8c12886c.nuxthub-module.pages.dev
Branch Preview URL: https://feat-openapi.nuxthub-module.pages.dev

View logs

@pi0
Copy link

pi0 commented Mar 28, 2024

If you want to introduce this feature before Nitro 2.10 via experimental flag:

  • Make sure to check nitro.options.experimental.openapi === true to show the tab otherwise show instructions on how users can opt-in (please never implicitly enable an experimental flag for users!)

  • Make sure to use dynamic import inside the handler and test if having an invalid virtual won't break the hub. Internal virtual can change all the time and this implementation shouldn't break whole builds!

  • I don't see any authentication. Please make sure to authenticate with object syntax and explicit utility (instead of implicit middleware) to make sure the API is not unwillingly exposed.

Copy link
Contributor

atinux commented Mar 29, 2024

Thank you for the feedback 😊

For the middleware we will refactor it to assign on each route in another PR, thanks for the reminder!
The middleware is https://github.com/nuxt-hub/core/blob/main/src/module/runtime/server/middleware/1.hub-auth.ts

@atinux atinux merged commit 45db380 into main Apr 2, 2024
@atinux atinux deleted the feat/openapi branch April 2, 2024 09:54
Aslemammad pushed a commit to Aslemammad/nuxt-core that referenced this pull request Jun 12, 2024
* feat: expose openapi spec under `_hub` secure routes

* fix: apply review
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.

3 participants