Skip to content

Commit

Permalink
Fix quickstart typo (#730)
Browse files Browse the repository at this point in the history
Previous example gives error:

```
** (FunctionClauseError) no function clause matching in Tesla.Builder.runtime/1    
    
    The following arguments were given to Tesla.Builder.runtime/1:
    
        # 1
        "http://localhost:4001"
    
    Attempted function clauses (showing 4 out of 4):
    
        defp runtime(list) when is_list(list)
        defp runtime({module, opts}) when is_atom(module)
        defp runtime(fun) when is_function(fun)
        defp runtime(module) when is_atom(module)
    
    (tesla 1.13.2) lib/tesla/builder.ex:203: Tesla.Builder.runtime/1
    (elixir 1.16.1) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.16.1) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (tesla 1.13.2) lib/tesla/builder.ex:176: Tesla.Builder.client/3
    iex:1: (file)
```
  • Loading branch information
feynmanliang authored Nov 20, 2024
1 parent 0687cfc commit 5c24357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tesla.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Tesla do
defmodule ExampleApi do
def client do
Tesla.client([
Tesla.Middleware.BaseUrl, "http://api.example.com",
{Tesla.Middleware.BaseUrl, "http://api.example.com"},
Tesla.Middleware.JSON
])
end
Expand Down

0 comments on commit 5c24357

Please sign in to comment.