This module provides access to the Conn type, which combines three types: Express.Request, Express.Response, and
your application's model/state. The Conn type is designed to easily transfer request information through your
application's functions.
The send function is a utility function that encodes a Conn into a JSON object that can be sent through the
responsePort of your application. The JavaScript part of elm-express expects the JSON object to have a certain
format, which can be achieved using this function. Once the Conn has been encoded, you can use the following pattern
to send your responses:
conn |> Express.Conn.send |> responsePortThis will send the encoded Conn through the responsePort, allowing you to respond to the client with the
appropriate data.
The
Conntype is a combination of theExpress.Request,Express.Responsetypes and your application's model/state. It is used to efficiently pass request information through your app's functions.