Middleware
Middleware can be either synchronous or asynchronous.
Context
The ChatAlly application gathers an execution context for each middleware module with a request and a response object, which are provided by the server that triggered the handling.
ChatRequest
Chat request with incoming message, which is combined with a message type
ChatResponse
await next()
With a call to await next()
, you can execute parts of your middleware in the downstream leg of the request handling, i.e. after other middleware modules that have been registered after this module, but before the downstream part of middleware modules registered before this module.
IMediaServer
This feature allows to load media assets on demand.
Logger
The log
is a context-specific logger for the middleware, that is created as a child logger of the application.
For details, have a look at the Logger reference documentation
data
The data can contain arbitrary data. It can be static data, which is added by the application for each request, e.g. a database to access persisted data or a wrapped REST API, which can be accessed on demand. It can also be data, that is added by upstream middleware or downstream middleware after a call to await next()
.