Skip to main content
Use the ExpressEndpoint adapter to expose your agent network as an Express route.

Setup

  1. Install m4trix and Express:
  1. Create your Express app:

Important

  • body-parser — Use express.json() (or equivalent) so POST bodies are parsed. The handler reads req.body for the payload.
  • Client disconnect — The handler listens for the close event and cleans up the stream.
  • Compression — If using compression middleware, the handler calls res.flush() when available for better streaming.