Endpoint
An endpoint
is a way of providing a function accessible using a [request][request]. A single request will only ever be routed to a single endpoint.
Create and start an endpoint
remit.endpoint(event[, ...handlers])
creates a new endpoint that responds to [requests][request] to event
. Options can be passed in straight away by passing an object in place of event
. If an object is passed, the event
key is required. See endpoint.options
for available options.
Handlers are a list of functions that will process the incoming data and return a result. For more information on handlers for both endpoints and listeners, see the [Handlers][handlers] guide.
Set options
Pause and resume
Add listeners
endpoint.on
can be used to register listeners for events specific to a created endpoint. See the [Events][events] page for more information on the events emitted.
Returns a reference to the endpoint
so that calls can be chained.