toppage_handler.erl 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. %% Feel free to use, reuse and abuse the code in this file.
  2. %% @doc Compress response handler.
  3. -module(toppage_handler).
  4. -export([init/3]).
  5. -export([handle/2]).
  6. -export([terminate/3]).
  7. init(_Transport, Req, []) ->
  8. {ok, Req, undefined}.
  9. handle(Req, State) ->
  10. BigBody =
  11. <<"A cowboy is an animal herder who tends cattle on ranches in North America,
  12. traditionally on horseback, and often performs a multitude of other ranch-
  13. related tasks. The historic American cowboy of the late 19th century arose
  14. from the vaquero traditions of northern Mexico and became a figure of special
  15. significance and legend. A subtype, called a wrangler, specifically tends the
  16. horses used to work cattle. In addition to ranch work, some cowboys work for
  17. or participate in rodeos. Cowgirls, first defined as such in the late 19th
  18. century, had a less-well documented historical role, but in the modern world
  19. have established the ability to work at virtually identical tasks and obtained
  20. considerable respect for their achievements. There are also cattle handlers
  21. in many other parts of the world, particularly South America and Australia,
  22. who perform work similar to the cowboy in their respective nations.\n">>,
  23. {ok, Req2} = cowboy_req:reply(200, [], BigBody, Req),
  24. {ok, Req2, State}.
  25. terminate(_Reason, _Req, _State) ->
  26. ok.