diff --git a/src/mochiweb.app.src b/src/mochiweb.app.src index 6a15c662..e1298356 100644 --- a/src/mochiweb.app.src +++ b/src/mochiweb.app.src @@ -4,7 +4,6 @@ {vsn, "2.0.0"}, {modules, []}, {registered, []}, - {mod, {mochiweb_app, []}}, {env, []}, {applications, [kernel, stdlib, crypto, inets, ssl, xmerl, compiler, syntax_tools]}]}. diff --git a/src/mochiweb.erl b/src/mochiweb.erl index 7ba55805..9512a6e9 100644 --- a/src/mochiweb.erl +++ b/src/mochiweb.erl @@ -6,23 +6,10 @@ -module(mochiweb). -author('bob@mochimedia.com'). --export([start/0, stop/0]). -export([new_request/1, new_response/1]). -export([all_loaded/0, all_loaded/1, reload/0]). -export([ensure_started/1]). -%% @spec start() -> ok -%% @doc Start the MochiWeb server. -start() -> - ensure_started(crypto), - application:start(mochiweb). - -%% @spec stop() -> ok -%% @doc Stop the MochiWeb server. -stop() -> - ok = application:stop(mochiweb), - ok = application:stop(crypto). - reload() -> [c:l(Module) || Module <- all_loaded()]. @@ -78,7 +65,6 @@ new_response({Request, Code, Headers}) -> Code, mochiweb_headers:make(Headers)). - %% @spec ensure_started(App::atom()) -> ok %% @doc Start the given App if it has not been started already. ensure_started(App) -> @@ -89,7 +75,6 @@ ensure_started(App) -> ok end. - %% %% Tests %% diff --git a/src/mochiweb_app.erl b/src/mochiweb_app.erl deleted file mode 100644 index 4b871576..00000000 --- a/src/mochiweb_app.erl +++ /dev/null @@ -1,27 +0,0 @@ -%% @author Bob Ippolito -%% @copyright 2007 Mochi Media, Inc. - -%% @doc Callbacks for the mochiweb application. - --module(mochiweb_app). --author('bob@mochimedia.com'). - --behaviour(application). --export([start/2,stop/1]). - -%% @spec start(_Type, _StartArgs) -> ServerRet -%% @doc application start callback for mochiweb. -start(_Type, _StartArgs) -> - mochiweb_sup:start_link(). - -%% @spec stop(_State) -> ServerRet -%% @doc application stop callback for mochiweb. -stop(_State) -> - ok. - -%% -%% Tests -%% --ifdef(TEST). --include_lib("eunit/include/eunit.hrl"). --endif. diff --git a/src/mochiweb_sup.erl b/src/mochiweb_sup.erl deleted file mode 100644 index ad24db65..00000000 --- a/src/mochiweb_sup.erl +++ /dev/null @@ -1,41 +0,0 @@ -%% @author Bob Ippolito -%% @copyright 2007 Mochi Media, Inc. - -%% @doc Supervisor for the mochiweb application. - --module(mochiweb_sup). --author('bob@mochimedia.com'). - --behaviour(supervisor). - -%% External exports --export([start_link/0, upgrade/0]). - -%% supervisor callbacks --export([init/1]). - -%% @spec start_link() -> ServerRet -%% @doc API for starting the supervisor. -start_link() -> - supervisor:start_link({local, ?MODULE}, ?MODULE, []). - -%% @spec upgrade() -> ok -%% @doc Add processes if necessary. -upgrade() -> - {ok, {_, Specs}} = init([]), - lists:foreach(fun(S) -> supervisor:start_child(?MODULE, S) end, Specs), - ok. - -%% @spec init([]) -> SupervisorTree -%% @doc supervisor callback, ensures yaws is in embedded mode and then -%% returns the supervisor tree. -init([]) -> - Processes = [], - {ok, {{one_for_one, 10, 10}, Processes}}. - -%% -%% Tests -%% --ifdef(TEST). --include_lib("eunit/include/eunit.hrl"). --endif.