From 216bcb312d87279e006f4da7e2eab5f216a039c9 Mon Sep 17 00:00:00 2001 From: Shibani <874357+shibani@users.noreply.github.com> Date: Wed, 22 Aug 2018 10:14:18 -0400 Subject: [PATCH 1/2] Prod.exs settings when using React with Mix If using React in a project where Brunch has been removed and Webpack has been added in instead If using Heroku Buildpack for Elixir but not Phoenix Static Buildpack, `server:true` should be added to `config/prod.exs` --- docs/source/main.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/source/main.rst b/docs/source/main.rst index ed67411..80108d8 100644 --- a/docs/source/main.rst +++ b/docs/source/main.rst @@ -240,6 +240,22 @@ You don't have to worry about setting your :bash:`SECRET_KEY_BASE` config becaus .. _`modifying existing app with distillery`: +When removing brunch and using webpack instead, in order to use React instead of static assets, it is important to +1. make sure the Phoenix static buildpack is not included in your project +2. add `server:true` to the settings in `config/prod.exs` as shown in the block below + +.. code-block:: elixir + + config :gigalixir_getting_started, GigalixirGettingStartedWeb.Endpoint, + secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE") + server: true + + config :gigalixir_getting_started, GigalixirGettingStarted.Repo, + adapter: Ecto.Adapters.Postgres, + url: System.get_env("DATABASE_URL"), + ssl: true, + pool_size: 1 # Free tier db only allows 1 connection + Using Distillery ---------------- From 8033870cdbb9213b86e30289ad9a987b53b4f38e Mon Sep 17 00:00:00 2001 From: Shibani <874357+shibani@users.noreply.github.com> Date: Wed, 22 Aug 2018 10:17:13 -0400 Subject: [PATCH 2/2] Update main.rst --- docs/source/main.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/main.rst b/docs/source/main.rst index 80108d8..47008e9 100644 --- a/docs/source/main.rst +++ b/docs/source/main.rst @@ -241,8 +241,9 @@ You don't have to worry about setting your :bash:`SECRET_KEY_BASE` config becaus .. _`modifying existing app with distillery`: When removing brunch and using webpack instead, in order to use React instead of static assets, it is important to -1. make sure the Phoenix static buildpack is not included in your project -2. add `server:true` to the settings in `config/prod.exs` as shown in the block below + +1. make sure the Phoenix static buildpack is not included in your project +2. add `server:true` to the settings in `config/prod.exs` as shown in the block below .. code-block:: elixir