mirror of
https://github.com/benbusby/farside.git
synced 2025-04-20 02:48:42 +00:00

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.
16 lines
424 B
Elixir
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
|