Aino.Token.Response (aino v0.6.0)

Shortcuts for returning common responses

HTML, redirecting, etc

Link to this section Summary

Functions

Sets token fields to render the response body as html

Sets the required token fields be a redirect.

Link to this section Functions

Link to this function

html(token, html)

Sets token fields to render the response body as html

iex> token = %{}
iex> Token.Response.html(token, "HTML Body")
%{
  response_headers: [{"Content-Type", "text/html"}],
  response_body: "HTML Body"
}
Link to this function

redirect(token, url)

Sets the required token fields be a redirect.

iex> token = %{}
iex> Token.Response.redirect(token, "/")
%{
  response_status: 302,
  response_headers: [{"Content-Type", "text/html"}, {"Location", "/"}],
  response_body: "Redirecting..."
}