Skip to content

API reference / @chanx-js/server / node / asyncapiMiddleware

Function: asyncapiMiddleware() ​

ts
function asyncapiMiddleware(chanx, options?): (request, response, next?) => void;

Defined in: packages/server/src/adapters/node.ts:90

Serve the AsyncAPI document on a Node HTTP server, as asyncapiHandler() does: Express or Connect middleware, mounted at the root. Other requests go to next.

ts
expressApp.use(asyncapiMiddleware(chanx, { title: 'Chat API' }));

Parameters ​

ParameterType
chanxChanx
options?AsyncAPIServeOptions

Returns ​

(request, response, next?) => void

MIT licensed