diff --git a/config/runtime.exs b/config/runtime.exs index aca95d6b..7e965a9b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,5 +1,13 @@ import Config +config :beacon, + radiator: [ + site: :radiator, + repo: Radiator.Repo, + endpoint: RadiatorWeb.Endpoint, + router: RadiatorWeb.Router + ] + # config/runtime.exs is executed for all environments, including # during releases. It is executed after compilation and before the # system starts, so it is typically used to load production configuration diff --git a/lib/radiator/application.ex b/lib/radiator/application.ex index afdf1ed8..ad6e4b90 100644 --- a/lib/radiator/application.ex +++ b/lib/radiator/application.ex @@ -29,6 +29,7 @@ defmodule Radiator.Application do # Start to serve requests, typically the last entry RadiatorWeb.Endpoint, {CommandQueue, name: CommandQueue}, + {Beacon, [sites: [Application.fetch_env!(:beacon, :radiator)]]}, {CommandProcessor, name: CommandProcessor, subscribe_to: [{CommandQueue, max_demand: 1}]}, {NodeChangeListener, name: NodeChangeListener}, {Registry, keys: :unique, name: Radiator.JobRegistry}, diff --git a/lib/radiator_web/router.ex b/lib/radiator_web/router.ex index be098ebe..b10ddb12 100644 --- a/lib/radiator_web/router.ex +++ b/lib/radiator_web/router.ex @@ -1,6 +1,7 @@ defmodule RadiatorWeb.Router do use RadiatorWeb, :router + use Beacon.Router use Beacon.LiveAdmin.Router import RadiatorWeb.UserAuth @@ -25,6 +26,7 @@ defmodule RadiatorWeb.Router do scope "/" do pipe_through [:browser, :beacon_admin] beacon_live_admin "/admin" + beacon_site "/cms", site: :radiator end scope "/", RadiatorWeb do diff --git a/priv/repo/migrations/20241119171313_create_beacon_tables.exs b/priv/repo/migrations/20241119171313_create_beacon_tables.exs new file mode 100644 index 00000000..5d025979 --- /dev/null +++ b/priv/repo/migrations/20241119171313_create_beacon_tables.exs @@ -0,0 +1,6 @@ +defmodule Radiator.Repo.Migrations.CreateBeaconTables do + use Ecto.Migration + + def up, do: Beacon.Migration.up() + def down, do: Beacon.Migration.down() +end