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
#override with: config :fsdb, path: <NEW_PATH>
path = Application.get_env(:fsdb, :path, Path.expand(".fsdb"))
children = [worker(Fsdb.Server, [[path: path], [name: Fsdb.Server]])]
Supervisor.start_link(children, strategy: :one_for_one, name: Fsdb.Sup)
end
end