Returns a server middleware that serves the AsyncAPI 3.0 spec as JSON at the configured path (default: /asyncapi.json).
/asyncapi.json
The spec is lazily generated on the first request and cached for subsequent requests.
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' }, }, })); Copy
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' }, }, }));
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.