nitro icon indicating copy to clipboard operation
nitro copied to clipboard

openapi in nitro only work in local development do not work when deploy with cloudflare pages

Open hoanglinh9955 opened this issue 9 months ago • 2 comments

Environment

  • nuxt: 3.11.2
  • nitro: 2.9.6
  • nitro-cloudflare-dev: 0.1.4

Reproduction

  • Repo: https://github.com/hoanglinh9955/links
  • my deploy url can not open with end point /_nitro/scalar /_nitro/swagger /_nitro/openapi.json

Describe the bug

Context

  • Openapi url return 404 when access to endpoint /_nitro/scalar /_nitro/swagger /_nitro/openapi.json in production mode
  • The OpenAPI is available on http://localhost:3000/_nitro/openapi.json

I can access on local mode image

Nuxt config file


export default defineNuxtConfig({
  devtools: { enabled: true },

  nitro: {
    preset: "cloudflare-pages",
    experimental: {
      openAPI: true,
    },
  },

  modules: ["nitro-cloudflare-dev", "@nuxt/ui"]
})

Additional context

No response

Logs

No response

hoanglinh9955 avatar May 06 '24 17:05 hoanglinh9955