1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-04-20 02:48:42 +00:00
farside/lib/privacy_revolver/application.ex
Ben Busby 9a6d680213
Route service requests to an available instance
Router has been updated with a basic /:service/*glob endpoint, which
retrieves a list of instances for the requested service and picks a
random one to forward the user to (or falls back to a default instance
if none are found).

Should probably add a check to make sure the requested service exists
first.
2021-10-22 19:18:33 -06:00

16 lines
424 B
Elixir

defmodule PrivacyRevolver.Application do
@moduledoc false
use Application
@impl true
def start(_type, _args) do
children = [
Plug.Cowboy.child_spec(scheme: :http, plug: PrivacyRevolver.Router, options: [port: 4001]),
{Redix, {"redis://localhost:6379", [name: :redix]}}
]
opts = [strategy: :one_for_one, name: PrivacyRevolver.Supervisor]
Supervisor.start_link(children, opts)
end
end