1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-04-20 19:08:42 +00:00
farside/lib/farside/application.ex
Ben Busby 1092350fcd
Remove FARSIDE_NO_ROUTER env var
The FARSIDE_NO_ROUTER variable wasn't terribly useful after refactoring
the app to include the update routine internally (rather than available
externally as an elixir script).

Now the only supported environment variable is FARSIDE_TEST, which is
still useful for tests and quick validation of functionality.
2021-12-09 15:33:58 -07:00

27 lines
697 B
Elixir

defmodule Farside.Application do
@farside_port Application.fetch_env!(:farside, :port)
@redis_conn Application.fetch_env!(:farside, :redis_conn)
@moduledoc false
use Application
@impl true
def start(_type, _args) do
children = [
Plug.Cowboy.child_spec(
scheme: :http,
plug: Farside.Router,
options: [
port: @farside_port
]
),
{PlugAttack.Storage.Ets, name: Farside.Throttle.Storage, clean_period: 60_000},
{Redix, {@redis_conn, [name: :redix]}},
Farside.Scheduler,
Farside.Server
]
opts = [strategy: :one_for_one, name: Farside.Supervisor]
Supervisor.start_link(children, opts)
end
end