erlk/src/erlk_app.erl

26 lines
580 B
Erlang

%%%-------------------------------------------------------------------
%% @doc erlk public API
%% @end
%%%-------------------------------------------------------------------
-module(erlk_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
DBPath = case os:getenv("ERLK_DB") of
false ->
ConfigRoot = os:getenv("HOME", "/etc"),
io_lib:format("~s/erlk.db", [ConfigRoot]);
Value -> Value
end,
erlk_sup:start_link(DBPath).
stop(_State) ->
ok.
%% internal functions