Skip to content

Commit

Permalink
refactor(Algolia): tweak application config (#1780)
Browse files Browse the repository at this point in the history
* refactor: migrate to updated Config module

* change index suffix to default to "_test"

* chore: remove unused config
  • Loading branch information
thecristen authored Nov 7, 2023
1 parent 078dd1b commit ed450ed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
33 changes: 3 additions & 30 deletions apps/algolia/config/config.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

config :algolia, :config,
app_id: {:system, "ALGOLIA_APP_ID"},
Expand All @@ -18,33 +16,8 @@ config :algolia, :indexes, [

config :algolia, :track_clicks?, false

config :algolia, :index_suffix, ""
config :algolia, :index_suffix, "_test"

config :algolia, :http_pool, :algolia_http_pool

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
# if you want to provide default values for your application for
# 3rd-party users, it should be done in your "mix.exs" file.

# You can configure your application as:
#
# config :algolia, key: :value
#
# and access this configuration in your application as:
#
# Application.get_env(:algolia, :key)
#
# You can also configure a 3rd-party app:
#
# config :logger, level: :info
#

# It is also possible to import configuration files, relative to this
# directory. For example, you can emulate configuration per environment
# by uncommenting the line below and defining dev.exs, test.exs and such.
# Configuration from the imported file will override the ones defined
# here (which is why it is important to import them last).
#
import_config "#{Mix.env()}.exs"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion apps/algolia/config/dev.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use Mix.Config
import Config
8 changes: 2 additions & 6 deletions apps/algolia/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
use Mix.Config

config :algolia, :keys,
app_id: "${ALGOLIA_APP_ID}",
search: "${ALGOLIA_SEARCH_KEY}",
write: "${ALGOLIA_WRITE_KEY}"
import Config

config :algolia, :click_analytics_url, "https://insights.algolia.io"
config :algolia, :track_clicks?, true
config :algolia, :track_analytics?, true
config :algolia, :index_suffix, ""
4 changes: 1 addition & 3 deletions apps/algolia/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :algolia, :config,
app_id: "ALGOLIA_APP_ID",
Expand All @@ -14,5 +14,3 @@ config :algolia, :indexes, [
]

config :algolia, :click_analytics_url, :not_set

config :algolia, :index_suffix, "_test"

0 comments on commit ed450ed

Please sign in to comment.