Skip to content

Commit 72efc61

Browse files
committed
heroku config
1 parent fbc993b commit 72efc61

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: MIX_ENV=prod mix phx.server

config/prod.exs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@ use Mix.Config
1515
# which you typically run after static files are built.
1616
config :hello, HelloWeb.Endpoint,
1717
load_from_system_env: true,
18-
url: [host: "example.com", port: 80],
19-
cache_static_manifest: "priv/static/cache_manifest.json"
18+
url: [scheme: "https", host: "borker-elixir.herokuapp.com", port: 443],
19+
force_ssl: [rewrite_on: [:x_forwarded_proto]],
20+
cache_static_manifest: "priv/static/cache_manifest.json",
21+
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE")
2022

2123
# Do not print debug messages in production
2224
config :logger, level: :info
2325

26+
config :hello, Hello.Repo,
27+
adapter: Ecto.Adapters.Postgres,
28+
url: System.get_env("DATABASE_URL"),
29+
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
30+
ssl: true
31+
2432
# ## SSL Support
2533
#
2634
# To get SSL working, you will need to add the `https` key
@@ -58,7 +66,3 @@ config :logger, level: :info
5866
#
5967
# config :hello, HelloWeb.Endpoint, server: true
6068
#
61-
62-
# Finally import the config/prod.secret.exs
63-
# which should be versioned separately.
64-
import_config "prod.secret.exs"

lib/hello_web/channels/user_socket.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ defmodule HelloWeb.UserSocket do
55
# channel "room:*", HelloWeb.RoomChannel
66

77
## Transports
8-
transport :websocket, Phoenix.Transports.WebSocket
8+
transport :websocket, Phoenix.Transports.WebSocket,
9+
timeout: 45_000
910
# transport :longpoll, Phoenix.Transports.LongPoll
1011

1112
# Socket params are passed from the client and can

0 commit comments

Comments
 (0)