Packages

LowEndInsight is a simple 'bus-factor' risk analysis library for Open Source Software which is managed within a Git repository. Provide the git URL and the library will respond with a basic Elixir Map structure report.

Current section

Files

Jump to
lowendinsight lib lei application.ex
Raw

lib/lei/application.ex

defmodule Lei.Application do
@moduledoc """
OTP Application for LEI batch analysis service.
Starts the ETS-backed batch cache and optional HTTP endpoint.
"""
use Application
@impl true
def start(_type, _args) do
port = Application.get_env(:lowendinsight, :http_port, 4000)
children =
if Application.get_env(:lowendinsight, :start_http, false) do
[
Lei.BatchCache,
{Plug.Cowboy, scheme: :http, plug: Lei.Web.Router, options: [port: port]}
]
else
[Lei.BatchCache]
end
opts = [strategy: :one_for_one, name: Lei.Supervisor]
Supervisor.start_link(children, opts)
end
end