mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00

They are now cowboy:start_clear/3 and cowboy:start_tls/3. The NumAcceptors argument can be specified via the num_acceptor transport option. Ranch has been updated to 1.4.0 to that effect.
25 lines
437 B
Erlang
25 lines
437 B
Erlang
%% Feel free to use, reuse and abuse the code in this file.
|
|
|
|
%% @private
|
|
-module(hello_world_app).
|
|
-behaviour(application).
|
|
|
|
%% API.
|
|
-export([start/2]).
|
|
-export([stop/1]).
|
|
|
|
%% API.
|
|
|
|
start(_Type, _Args) ->
|
|
Dispatch = cowboy_router:compile([
|
|
{'_', [
|
|
{"/", toppage_handler, []}
|
|
]}
|
|
]),
|
|
{ok, _} = cowboy:start_clear(http, [{port, 8080}], #{
|
|
env => #{dispatch => Dispatch}
|
|
}),
|
|
hello_world_sup:start_link().
|
|
|
|
stop(_State) ->
|
|
ok.
|