Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (22 sloc) 958 Bytes
-module({{appid}}_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
case {{appid}}_sup:start_link() of
{ok, Pid} ->
ok = riak_core:register([{vnode_module, {{appid}}_vnode}]),
ok = riak_core_ring_events:add_guarded_handler({{appid}}_ring_event_handler, []),
ok = riak_core_node_watcher_events:add_guarded_handler({{appid}}_node_event_handler, []),
ok = riak_core_node_watcher:service_up({{appid}}, self()),
EntryRoute = {["{{appid}}", "ping"], {{appid}}_wm_ping, []},
webmachine_router:add_route(EntryRoute),
{ok, Pid};
{error, Reason} ->
{error, Reason}
end.
stop(_State) ->
ok.