Trifolium.Config (Trifolium v1.0.0)
Stores configuration variables used to communicate with Trefle's API.
All settings also accept {:system, "ENV_VAR_NAME"}
to read their
values from environment variables at runtime.
Link to this section Summary
Functions
Returns the domain of the Trefle API. This will default to "trefle.io/",
but can be overridden (in case you have a custom Trefle installation)
using the following setting in mix.exs
Return the combined base URL of the Trefle API, using the configuration settings given.
A light wrapper around Application.get_env/2
, providing automatic support for
{:system, "VAR"}
tuples.
Return the HTTP Client we should use to do this requests. You shouldn't need to change this in your app.
Returns the protocol used for the Trefle API. The default is "https"
for
interacting with the Trefle API, but when testing with Bypass, you may want
this to be "http"
. You can override this in mix.exs
with
Returns Trefle's API token. Set it in mix.exs
Link to this section Functions
api_domain()
Returns the domain of the Trefle API. This will default to "trefle.io/",
but can be overridden (in case you have a custom Trefle installation)
using the following setting in mix.exs
:
config :trifolium, api_domain: "trefle.yourdomain.com/"
base_url()
Return the combined base URL of the Trefle API, using the configuration settings given.
from_env(otp_app, key, default \\ nil)
A light wrapper around Application.get_env/2
, providing automatic support for
{:system, "VAR"}
tuples.
http_client()
Return the HTTP Client we should use to do this requests. You shouldn't need to change this in your app.
protocol()
Returns the protocol used for the Trefle API. The default is "https"
for
interacting with the Trefle API, but when testing with Bypass, you may want
this to be "http"
. You can override this in mix.exs
with:
config :trifolium, protocol: "http"
token()
Specs
token() :: String.t()
Returns Trefle's API token. Set it in mix.exs
:
config :trifolium, trefle_token: "YOUR_TREFLE_TOKEN"