Server

Server API

Discover how to generate API documentation for your Nuxt project.

This is currently experimental and subject to change in the future.

Getting Started

NuxtHub uses Nitro's OpenAPI generation to access your Nuxt project's API.

To enable the API, you need to add enable Nitro's experimental openAPI feature. You can do this by adding the nitro.experimental.openAPI property to your nuxt.config.ts file.

nuxt.config.ts
export default defineNuxtConfig({
  nitro: {
    experimental: {
      openAPI: true
    }
  }
})

After you deploy your project, NuxtHub Admin will showcase your API documentation using Scalar.

Nuxt Devtools

In development, you can use Nuxt Devtools to access your API routes. using the Server Routes tab.

It list all the API routes in your project as well as providing a playground to send and test your endpoints.

Check out the Nuxt Devtools documentation for more information.