PageRenderTime 218ms CodeModel.GetById 141ms app.highlight 1ms RepoModel.GetById 75ms app.codeStats 0ms

/support/templates/mochiwebapp_skel/src/mochiapp.erl

http://github.com/basho/mochiweb
Erlang | 30 lines | 16 code | 7 blank | 7 comment | 0 complexity | d6a8aae0a46c5dd771b7723910acbf75 MD5 | raw file
 1%% @author {{author}}
 2%% @copyright {{year}} {{author}}
 3
 4%% @doc {{appid}}.
 5
 6-module({{appid}}).
 7-author("{{author}}").
 8-export([start/0, stop/0]).
 9
10ensure_started(App) ->
11    case application:start(App) of
12        ok ->
13            ok;
14        {error, {already_started, App}} ->
15            ok
16    end.
17
18
19%% @spec start() -> ok
20%% @doc Start the {{appid}} server.
21start() ->
22    {{appid}}_deps:ensure(),
23    ensure_started(crypto),
24    application:start({{appid}}).
25
26
27%% @spec stop() -> ok
28%% @doc Stop the {{appid}} server.
29stop() ->
30    application:stop({{appid}}).