Browse files

Initial skeleton

  • Loading branch information...
0 parents commit 371d5d33f969c2cc611c148ff72df7af7b79df43 @yrashk committed Apr 30, 2011
Showing with 63 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +2 −0 rebar.config
  3. +13 −0 src/stayunlost.app.src
  4. +16 −0 src/stayunlost_app.erl
  5. +28 −0 src/stayunlost_sup.erl
4 .gitignore
@@ -0,0 +1,4 @@
+ebin
+.agner.config
+deps
+.eunit
2 rebar.config
@@ -0,0 +1,2 @@
+{rebar_plugins, [agner_rebar_plugin]}.
+{lib_dirs, ["deps"]}.
13 src/stayunlost.app.src
@@ -0,0 +1,13 @@
+{application, stayunlost,
+ [
+ {description, ""},
+ {vsn, "1"},
+ {registered, []},
+ {applications, [
+ kernel,
+ stdlib
+ ]},
+ {mod, { stayunlost_app, []}},
+ {agner, [{requires, ["cowboy"]}]},
+ {env, []}
+ ]}.
16 src/stayunlost_app.erl
@@ -0,0 +1,16 @@
+-module(stayunlost_app).
+
+-behaviour(application).
+
+%% Application callbacks
+-export([start/2, stop/1]).
+
+%% ===================================================================
+%% Application callbacks
+%% ===================================================================
+
+start(_StartType, _StartArgs) ->
+ stayunlost_sup:start_link().
+
+stop(_State) ->
+ ok.
28 src/stayunlost_sup.erl
@@ -0,0 +1,28 @@
+
+-module(stayunlost_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 371d5d3

Please sign in to comment.