Init project.

This commit is contained in:
2023-07-04 21:49:02 +03:00
commit 2c7bb30996
30 changed files with 1259 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
defmodule LinkShortener.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 = [
# Start the Ecto repository
LinkShortener.Repo,
# Start the Telemetry supervisor
LinkShortenerWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: LinkShortener.PubSub},
# Start the Endpoint (http/https)
LinkShortenerWeb.Endpoint
# Start a worker by calling: LinkShortener.Worker.start_link(arg)
# {LinkShortener.Worker, arg}
]
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: LinkShortener.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
LinkShortenerWeb.Endpoint.config_change(changed, removed)
:ok
end
end
+3
View File
@@ -0,0 +1,3 @@
defmodule LinkShortener.Mailer do
use Swoosh.Mailer, otp_app: :link_shortener
end
+5
View File
@@ -0,0 +1,5 @@
defmodule LinkShortener.Repo do
use Ecto.Repo,
otp_app: :link_shortener,
adapter: Ecto.Adapters.Postgres
end