toppage_handler.erl 343 B

12345678910111213141516
  1. %% Feel free to use, reuse and abuse the code in this file.
  2. %% @doc Hello world handler.
  3. -module(toppage_handler).
  4. -export([init/2]).
  5. -export([handle/2]).
  6. init(Req, Opts) ->
  7. {http, Req, Opts}.
  8. handle(Req, State) ->
  9. Req2 = cowboy_req:reply(200, [
  10. {<<"content-type">>, <<"text/plain">>}
  11. ], <<"Hello world!">>, Req),
  12. {ok, Req2, State}.