File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ defmodule Segment.Http do
4040 require Logger
4141 use Retry
4242
43- @ segment_api_url Application . get_env ( :segment , :api_url , "https://api.segment.io/v1/" )
44-
4543 @ doc """
4644 Create a Tesla client with the Segment Source Write API Key
4745 """
@@ -66,7 +64,7 @@ defmodule Segment.Http do
6664 @ spec client ( String . t ( ) , adapter ( ) ) :: client ( )
6765 def client ( api_key , adapter ) do
6866 middleware = [
69- { Tesla.Middleware.BaseUrl , @ segment_api_url } ,
67+ { Tesla.Middleware.BaseUrl , Segment.Config . api_url ( ) } ,
7068 Tesla.Middleware.JSON ,
7169 { Tesla.Middleware.BasicAuth , % { username: api_key , password: "" } }
7270 ]
Original file line number Diff line number Diff line change 11defmodule Segment.Config do
22 @ moduledoc false
33
4+ def api_url do
5+ Application . get_env ( :segment , :api_url , "https://api.segment.io/v1/" )
6+ end
7+
48 def service do
59 Application . get_env ( :segment , :sender_impl , Segment.Analytics.Batcher )
610 end
You can’t perform that action at this time.
0 commit comments