Packages
Minimal filesystem Erlang term text database.
Current section
Files
Jump to
Current section
Files
lib/app.ex
defmodule Fsdb.App do
@moduledoc """
App module.
"""
use Application
import Supervisor.Spec
@doc """
Stars the app by launching the supervisor.
Returns `{:ok, pid}`.
"""
def start(_type, _args) do
#fixed default
defpath = Path.expand("~/.fsdb")
#override from specific environment config
path = Application.get_env(:fsdb, :path, defpath)
children = [worker(Fsdb.Server, [[path: path], [name: Fsdb.Server]])]
Supervisor.start_link(children, strategy: :one_for_one, name: Fsdb.Sup)
end
end