Skip to content

Commit

Permalink
step one
Browse files Browse the repository at this point in the history
  • Loading branch information
phuesler committed Oct 4, 2012
1 parent b8cde6a commit 8f5a6f9
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
@@ -1,3 +1,7 @@
# Aloha Ruby Conference demo application

Hopefully, when it's grown up, this will be an Erlang web app starter kit.

# Steps

rebar create app or something
12 changes: 12 additions & 0 deletions src/aloha.app.src
@@ -0,0 +1,12 @@
{application, aloha,
[
{description, ""},
{vsn, "1"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{mod, { aloha_app, []}},
{env, []}
]}.
16 changes: 16 additions & 0 deletions src/aloha_app.erl
@@ -0,0 +1,16 @@
-module(aloha_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================

start(_StartType, _StartArgs) ->
aloha_sup:start_link().

stop(_State) ->
ok.
28 changes: 28 additions & 0 deletions src/aloha_sup.erl
@@ -0,0 +1,28 @@

-module(aloha_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
{ok, { {one_for_one, 5, 10}, []} }.

0 comments on commit 8f5a6f9

Please sign in to comment.