%%%------------------------------------------------------------------- %% @doc fire public API %% @end %%%------------------------------------------------------------------- -module(fire_app). -behaviour(application). %% Application callbacks -export([start/2, stop/1]). %%==================================================================== %% API %%==================================================================== start(_Type, _Args) -> Dispatch = cowboy_router:compile([ {'_', [ {"/", fire_handler, []} ]} ]), {ok, _} = cowboy:start_clear(http, [{port, 8080}], #{ env => #{dispatch => Dispatch} }), fire_sup:start_link(). stop(_State) -> ok. %%==================================================================== %% Internal functions %%====================================================================