Skip to content

Commit

Permalink
Use port 32002 as safe efault
Browse files Browse the repository at this point in the history
Because 5432 clashes with postgres default port. Fixes #5
  • Loading branch information
Alexey Nikitin committed Aug 2, 2018
1 parent 689a203 commit c8f43a9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/chuck/src/chuck.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-define(HOST, "api.chucknorris.io").
-else.
-define(PROTO, "http").
-define(HOST, "localhost:5432").
-define(HOST, "localhost:32002").
-endif.

random() ->
Expand Down
2 changes: 1 addition & 1 deletion examples/chuck_ex/config/test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Mix.Config

config :chuck_norris_api,
host: "localhost:5432",
host: "localhost:32002",
proto: "http"
2 changes: 1 addition & 1 deletion src/bookish_spork.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
capture_request/0
]).

-define(DEFAUT_PORT, 5432).
-define(DEFAUT_PORT, 32002).
-define(RECEIVE_REQUEST_TIMEOUT_MILLIS, 1000).

-type http_status() :: non_neg_integer().
Expand Down
4 changes: 2 additions & 2 deletions test/bookish_spork_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ base_integration_test(_Config) ->

RequestHeaders = [],
{ok, {{"HTTP/1.1", 204, "No Content"}, _ResponseHeaders, _Body}} =
httpc:request(get, {"http://localhost:5432/o/lo/lo?q=kjk", RequestHeaders}, [], []),
httpc:request(get, {"http://localhost:32002/o/lo/lo?q=kjk", RequestHeaders}, [], []),

{ok, Request} = ?T:capture_request(),
?assertEqual('GET', bookish_spork_request:method(Request)),
?assertEqual("/o/lo/lo?q=kjk", bookish_spork_request:uri(Request)),
?assertEqual({1, 1}, bookish_spork_request:version(Request)),
?assertMatch(#{"host" := "localhost:5432"}, bookish_spork_request:headers(Request)),
?assertMatch(#{"host" := "localhost:32002"}, bookish_spork_request:headers(Request)),
ok = ?T:stop_server().


Expand Down

0 comments on commit c8f43a9

Please sign in to comment.