Endpoint
All routes are compiled to a private endpoint function.
Consider this example:
get "/foo/bar" do
Plug.Conn.send_resp(conn, 200, "hello")
end
It is compiled to:
defp endpoint(%Plug.Conn{
method: "GET",
private: %{
maru_resource_path: ["foo", "bar"]
}
}=conn, []) do
Plug.Conn.send_resp(conn, 200, "hello")
end
As you can see, the function endpoint is also a plug, which will be plugged into call/2 to compile plugged module.
Updated less than a minute ago
