Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosescri committed Oct 7, 2022
1 parent 0c8be8a commit 80fea7f
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 103 deletions.
14 changes: 1 addition & 13 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ config :chess, ChessWeb.Endpoint,
url: [host: "localhost"],
render_errors: [view: ChessWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Chess.PubSub,
live_view: [signing_salt: "QXFjZzJk"]

# Configures the mailer
#
# By default it uses the "Local" adapter which stores the emails
# locally. You can see the emails in your browser, at "/dev/mailbox".
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :chess, Chess.Mailer, adapter: Swoosh.Adapters.Local

# Swoosh API client is needed for adapters other than SMTP.
config :swoosh, :api_client, false
live_view: [signing_salt: "wBUdubgi"]

# Configure esbuild (the version is required)
config :esbuild,
Expand Down
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ config :chess, ChessWeb.Endpoint,
check_origin: false,
code_reloader: true,
debug_errors: true,
secret_key_base: "qw+GTtunUvCHQbRwg3GF6Z4Dg5ykwioGdRNM1wkLHBdzt84QGjb9ZCQsE1kkY8nK",
secret_key_base: "kOH+UNoNTWquIBT0R86yHXSyXhAS7pjl0fxh56rTTgcFoEAChiJ73hhc9lSt+OF/",
watchers: [
# Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]}
Expand Down
18 changes: 0 additions & 18 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,4 @@ if config_env() == :prod do
port: port
],
secret_key_base: secret_key_base

# ## Configuring the mailer
#
# In production you need to configure the mailer to use a different adapter.
# Also, you may need to configure the Swoosh API client of your choice if you
# are not using SMTP. Here is an example of the configuration:
#
# config :chess, Chess.Mailer,
# adapter: Swoosh.Adapters.Mailgun,
# api_key: System.get_env("MAILGUN_API_KEY"),
# domain: System.get_env("MAILGUN_DOMAIN")
#
# For this example you need include a HTTP client required by Swoosh API client.
# Swoosh supports Hackney and Finch out of the box:
#
# config :swoosh, :api_client, Swoosh.ApiClient.Hackney
#
# See https://hexdocs.pm/swoosh/Swoosh.html#module-installation for details.
end
6 changes: 1 addition & 5 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import Config
# you can enable the server option below.
config :chess, ChessWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "2PABQyNOrXJFFPfe9zJDiX/1o3O9xM8bj7cQVnbLLLdEK1GHJQ4Yzj2V4pcAUeWF",
secret_key_base: "MiM7rornnbhErND7y8xK8TMLfYpj7rGVXJmTndWVlqwBMnvzZiaRgiejVhQBrcNL",
server: false

# In test we don't send emails.
config :chess, Chess.Mailer,
adapter: Swoosh.Adapters.Test

# Print only warnings and errors during test
config :logger, level: :warn

Expand Down
3 changes: 0 additions & 3 deletions lib/chess/mailer.ex

This file was deleted.

6 changes: 1 addition & 5 deletions lib/chess_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule ChessWeb.Endpoint do
@session_options [
store: :cookie,
key: "_chess_key",
signing_salt: "fYOeaSjb"
signing_salt: "y/33nBbH"
]

socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]
Expand All @@ -30,10 +30,6 @@ defmodule ChessWeb.Endpoint do
plug Phoenix.CodeReloader
end

plug Phoenix.LiveDashboard.RequestLogger,
param_key: "request_logger",
cookie_key: "request_logger"

plug Plug.RequestId
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

Expand Down
29 changes: 0 additions & 29 deletions lib/chess_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,4 @@ defmodule ChessWeb.Router do
# scope "/api", ChessWeb do
# pipe_through :api
# end

# Enables LiveDashboard only for development
#
# If you want to use the LiveDashboard in production, you should put
# it behind authentication and allow only admins to access it.
# If your application does not have an admins-only section yet,
# you can use Plug.BasicAuth to set up some basic authentication
# as long as you are also using SSL (which you should anyway).
if Mix.env() in [:dev, :test] do
import Phoenix.LiveDashboard.Router

scope "/" do
pipe_through :browser

live_dashboard "/dashboard", metrics: ChessWeb.Telemetry
end
end

# Enables the Swoosh mailbox preview in development.
#
# Note that preview only shows emails that were sent by the same
# node running the Phoenix server.
if Mix.env() == :dev do
scope "/dev" do
pipe_through :browser

forward "/mailbox", Plug.Swoosh.MailboxPreview
end
end
end
2 changes: 0 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ defmodule Chess.MixProject do
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.17.5"},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.6"},
{:esbuild, "~> 0.4", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:jason, "~> 1.2"},
Expand Down
27 changes: 0 additions & 27 deletions mix.lock

This file was deleted.

0 comments on commit 80fea7f

Please sign in to comment.