fix: use Bandit adapter via config — Phoenix boots on port 4001

- Add adapter: Bandit.PhoenixAdapter to config.exs and dev.exs
- Phoenix reads adapter from app config, not from use macro option
- Verified: Bandit 1.11.0 starts successfully on 0.0.0.0:4001

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-09 20:25:18 +02:00
parent 453a6deead
commit 97b99c3fe3
26 changed files with 17 additions and 7 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
erl_crash.dump

View file

@ -1,5 +1,5 @@
defmodule CentralcloudMy.Endpoint do defmodule CentralcloudMy.Endpoint do
use Phoenix.Endpoint, otp_app: :centralcloud_my use Phoenix.Endpoint, otp_app: :centralcloud_my, adapter: Bandit.PhoenixAdapter
socket "/live", Phoenix.LiveView.Socket, socket "/live", Phoenix.LiveView.Socket,
websocket: [connect_info: [session: {CentralcloudMy.Router, :session_opts, []}]] websocket: [connect_info: [session: {CentralcloudMy.Router, :session_opts, []}]]

View file

@ -1,10 +1,12 @@
import Config import Config
config :centralcloud_my, CentralcloudMy.Endpoint, config :centralcloud_my, CentralcloudMy.Endpoint,
adapter: Bandit.PhoenixAdapter,
url: [host: "my.centralcloud.com"], url: [host: "my.centralcloud.com"],
http: [port: 4001] http: [port: 4001]
config :centralcloud_ops, CentralcloudOps.Endpoint, config :centralcloud_ops, CentralcloudOps.Endpoint,
adapter: Bandit.PhoenixAdapter,
url: [host: "ops.centralcloud.com"], url: [host: "ops.centralcloud.com"],
http: [port: 4000] http: [port: 4000]

View file

@ -1,15 +1,22 @@
import Config import Config
config :centralcloud_my, CentralcloudMy.Endpoint, config :centralcloud_my, CentralcloudMy.Endpoint,
code_reloader: true, adapter: Bandit.PhoenixAdapter,
debug_errors: true, http: [port: 4001],
check_origin: false, secret_key_base: "dev_only_secret_key_base_do_not_use_in_prod_needs_64_chars_minimum_xx",
watchers: []
config :centralcloud_ops, CentralcloudOps.Endpoint,
code_reloader: true, code_reloader: true,
debug_errors: true, debug_errors: true,
check_origin: false check_origin: false
config :centralcloud_ops, CentralcloudOps.Endpoint,
http: [port: 4000],
secret_key_base: "dev_only_ops_secret_key_base_do_not_use_in_prod_needs_64_chars_min_xx",
code_reloader: true,
debug_errors: true,
check_origin: false
# Disable Swoosh HTTP client in dev — no real email sending
config :swoosh, :api_client, false
config :logger, :console, format: "[$level] $message\n" config :logger, :console, format: "[$level] $message\n"
config :phoenix, :stacktrace_depth, 20 config :phoenix, :stacktrace_depth, 20