GUIDES
GUIDESDOCS
GUIDES
These docs are for v0.7.1. Click to read the latest docs for v0.13.

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.