echo_get_app.erl 449 B

1234567891011121314151617181920212223242526
  1. %% Feel free to use, reuse and abuse the code in this file.
  2. %% @private
  3. -module(echo_get_app).
  4. -behaviour(application).
  5. %% API.
  6. -export([start/2]).
  7. -export([stop/1]).
  8. %% API.
  9. start(_Type, _Args) ->
  10. Dispatch = [
  11. {'_', [
  12. {[], toppage_handler, []}
  13. ]}
  14. ],
  15. {ok, _} = cowboy:start_listener(http, 100,
  16. cowboy_tcp_transport, [{port, 8080}],
  17. cowboy_http_protocol, [{dispatch, Dispatch}]
  18. ),
  19. echo_get_sup:start_link().
  20. stop(_State) ->
  21. ok.