live_svelte/example_project/lib/example/application.ex
Denis Donici 553ea1e466
Upgrade example project. fix remounting Svelte component (#206)
* remove old link in example page. add real time for ecto example

* upgraded tailwind 4 and latest phoenix for example

* fixed svelte component remounting on server events

* generate auto ids for duplicate components

* handle static svelte components in live view parent properly

* prepare release 0.17.3 release

* adjust the live_svelte version in mix.exs
2026-02-08 13:47:39 +02:00

37 lines
1.1 KiB
Elixir

defmodule Example.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@impl true
def start(_type, _args) do
children = [
{NodeJS.Supervisor, [path: LiveSvelte.SSR.NodeJS.server_path(), pool_size: 4]},
# Start the Telemetry supervisor
ExampleWeb.Telemetry,
# Start the Ecto repository
Example.Repo,
# Start the PubSub system
{Phoenix.PubSub, name: Example.PubSub},
# Start the Endpoint (http/https)
ExampleWeb.Endpoint
# Start a worker by calling: Example.Worker.start_link(arg)
# {Example.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Example.Supervisor]
Supervisor.start_link(children, opts)
end
# Tell Phoenix to update the endpoint configuration
# whenever the application is updated.
@impl true
def config_change(changed, _new, removed) do
ExampleWeb.Endpoint.config_change(changed, removed)
:ok
end
end