Libraries
    Preparing search index...
    • Returns a server middleware that serves the AsyncAPI 3.0 spec as JSON at the configured path (default: /asyncapi.json).

      The spec is lazily generated on the first request and cached for subsequent requests.

      Parameters

      Returns (context: RequestContext, next: () => Promise<void>) => Promise<void>

      import { serveAsyncApi } from '@cleverbrush/server-openapi';

      server.use(
      serveAsyncApi({
      server,
      info: { title: 'My API', version: '1.0.0' },
      servers: {
      production: { host: 'api.example.com', protocol: 'wss' },
      },
      })
      );