Commit e99d4ea8 authored by Rémy Coutable's avatar Rémy Coutable 🏖

Prepare for Heroku

Signed-off-by: Rémy Coutable's avatarRémy Coutable <remy@rymai.me>
parent 0feae686
web: mix phx.server
......@@ -12,14 +12,14 @@ config :i_love_backend,
# Configures the endpoint
config :i_love_backend, ILoveBackendWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: System.get_env("SECRET_KEY_BASE") || "BsSzuYD4hw+cvO9s5ZosMB4G1k0/oI22ZdKwcd+GKq97AYRFeZk3ZEa2/Mhaj0aC",
secret_key_base: "BsSzuYD4hw+cvO9s5ZosMB4G1k0/oI22ZdKwcd+GKq97AYRFeZk3ZEa2/Mhaj0aC",
render_errors: [view: ILoveBackendWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: ILoveBackend.PubSub,
adapter: Phoenix.PubSub.PG2]
config :i_love_backend, admin_basic_auth: [
username: System.get_env("BASIC_AUTH_USERNAME") || "admin",
password: System.get_env("BASIC_AUTH_PASSWORD") || "admin",
username: "admin",
password: "admin",
realm: "Admin Area"
]
......
......@@ -51,7 +51,7 @@ config :phoenix, :stacktrace_depth, 20
# Configure your database
config :i_love_backend, ILoveBackend.Repo,
adapter: Ecto.Adapters.Postgres,
username: "postgres",
username: System.get_env("SECRET_KEY_BASE") || "postgres",
password: "postgres",
database: "i_love_backend_dev",
hostname: "localhost",
......
......@@ -15,12 +15,28 @@ use Mix.Config
# which you typically run after static files are built.
config :i_love_backend, ILoveBackendWeb.Endpoint,
load_from_system_env: true,
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
url: [scheme: "https", host: "i-love-api.herokuapp.com", port: 443],
force_ssl: [rewrite_on: [:x_forwarded_proto]],
cache_static_manifest: "priv/static/cache_manifest.json",
Map.fetch!(System.get_env(), "SECRET_KEY_BASE")
# Do not print debug messages in production
config :logger, level: :info
# Configure your database
config :hello, Hello.Repo,
adapter: Ecto.Adapters.Postgres,
url: System.get_env("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
ssl: true
# Admin area
config :i_love_backend, admin_basic_auth: [
username: System.get_env("BASIC_AUTH_USERNAME") || "admin",
password: Map.fetch!(System.get_env(), "BASIC_AUTH_PASSWORD"),
realm: "Admin Area"
]
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key
......
......@@ -5,7 +5,8 @@ defmodule ILoveBackendWeb.UserSocket do
# channel "room:*", ILoveBackendWeb.RoomChannel
## Transports
transport :websocket, Phoenix.Transports.WebSocket
transport :websocket, Phoenix.Transports.WebSocket,
timeout: 45_000
# transport :longpoll, Phoenix.Transports.LongPoll
# Socket params are passed from the client and can
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment