multiverse v0.5.1 Multiverse.Gate behaviour
Provides behaviour for Multiverse API Gateways.
Examples
defmodule GateName do
@behaviour MultiverseGate
def mutate_request(%Plug.Conn{} = conn) do
# Mutate your request here
IO.inspect "GateName.mutate_request applied to request"
conn
end
def mutate_response(%Plug.Conn{} = conn) do
# Mutate your response here
IO.inspect "GateName.mutate_response applied to response"
conn
end
end
Link to this section Summary
Link to this section Callbacks
Defines a request mutator.
This function will be called whenever Cowboy receives request.
Defines a response mutator.
This function will be called whenever Cowboy sends response to a consumer.