chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 28 forks source link

Add default config in `config.exs` + ability to configure Tesla middleware #71

Open ggiill opened 1 year ago

ggiill commented 1 year ago

Inspired by #42


Adding the ability to configure default options in config.exs:

Configure default settings in config/config.exs (optional).

   # config/config.exs
   config :ex_force, :api_version, "43.0"
   config :ex_force, :adapter, {Tesla.Adapter.Hackney, [recv_timeout: 1_000]}

As well as the ability to pass in custom Tesla Middleware:

   # config/config.exs
   config :ex_force, :middleware, [
      Tesla.Middleware.Telemetry,
      {Tesla.Middleware.Timeout, timeout: :timer.seconds(1)}
    ]