diff --git a/Gemfile b/Gemfile index ddf0ec8..242a70d 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem 'rails-api' gem 'active_model_serializers', '~> 0.10.0' gem 'rack-cors', require: 'rack/cors' gem 'rb-readline' +gem 'pg' gem 'bcrypt', '~> 3.1.11' group :production do diff --git a/Gemfile.lock b/Gemfile.lock index c0b9b1f..46fef95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,6 +72,7 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) + pg (0.18.4) pkg-config (1.1.7) pry (0.10.4) coderay (~> 1.1.0) @@ -165,6 +166,7 @@ DEPENDENCIES bcrypt (~> 3.1.11) byebug (~> 8.2.2) dotenv-rails (~> 2.1, >= 2.1.1) + pg pry (~> 0.10.3) pry-byebug (~> 3.3.0) pry-rails (~> 0.3.4) diff --git a/README.md b/README.md index cbd3759..e970b8e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ correspond to API actions. Request: ```sh -curl --include --request POST http://localhost:3000/sign-up \ +curl --include --request POST http://localhost:4741/sign-up \ --header "Content-Type: application/json" \ --data '{ "credentials": { @@ -106,7 +106,7 @@ Content-Type: application/json; charset=utf-8 Request: ```sh -curl --include --request POST http://localhost:3000/sign-in \ +curl --include --request POST http://localhost:4741/sign-in \ --header "Content-Type: application/json" \ --data '{ "credentials": { @@ -140,7 +140,7 @@ Content-Type: application/json; charset=utf-8 Request: ```sh -curl --include --request PATCH http://localhost:3000/change-password/$ID \ +curl --include --request PATCH http://localhost:4741/change-password/$ID \ --header "Authorization: Token token=$TOKEN" \ --header "Content-Type: application/json" \ --data '{ @@ -166,7 +166,7 @@ HTTP/1.1 204 No Content Request: ```sh -curl --include --request DELETE http://localhost:3000/sign-out/$ID \ +curl --include --request DELETE http://localhost:4741/sign-out/$ID \ --header "Authorization: Token token=$TOKEN" ``` @@ -192,7 +192,7 @@ HTTP/1.1 204 No Content Request: ```sh -curl --include --request GET http://localhost:3000/users \ +curl --include --request GET http://localhost:4741/users \ --header "Authorization: Token token=$TOKEN" ``` @@ -225,7 +225,7 @@ Content-Type: application/json; charset=utf-8 Request: ```sh -curl --include --request GET http://localhost:3000/users/$ID \ +curl --include --request GET http://localhost:4741/users/$ID \ --header "Authorization: Token token=$TOKEN" ``` diff --git a/config/boot.rb b/config/boot.rb index 6b750f0..1dd5cd6 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,15 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' # Set up gems listed in the Gemfile. + +# added to change default development port +require 'rails/commands/server' + +module DefaultOptions + DEV_PORT = 'GA'.each_byte.reduce('') { |a, e| a + format('%x', e) }.to_i + def default_options + super.merge(Port: DEV_PORT) + end +end + +Rails::Server.send(:prepend, DefaultOptions) diff --git a/scripts/change-password.sh b/scripts/change-password.sh index eedcadc..8f704c7 100755 --- a/scripts/change-password.sh +++ b/scripts/change-password.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --include --request PATCH http://localhost:3000/change-password/$ID \ +curl --include --request PATCH http://localhost:4741/change-password/$ID \ --header "Authorization: Token token=$TOKEN" \ --header "Content-Type: application/json" \ --data '{ diff --git a/scripts/sign-in.sh b/scripts/sign-in.sh index 34c6b99..4602b0a 100755 --- a/scripts/sign-in.sh +++ b/scripts/sign-in.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --include --request POST http://localhost:3000/sign-in \ +curl --include --request POST http://localhost:4741/sign-in \ --header "Content-Type: application/json" \ --data '{ "credentials": { diff --git a/scripts/sign-out.sh b/scripts/sign-out.sh index 4f74c84..dc2de94 100755 --- a/scripts/sign-out.sh +++ b/scripts/sign-out.sh @@ -1,4 +1,4 @@ #!/bin/bash -curl --include --request DELETE http://localhost:3000/sign-out/$ID \ +curl --include --request DELETE http://localhost:4741/sign-out/$ID \ --header "Authorization: Token token=$TOKEN" diff --git a/scripts/sign-up.sh b/scripts/sign-up.sh index a9ea773..2ada65f 100755 --- a/scripts/sign-up.sh +++ b/scripts/sign-up.sh @@ -1,6 +1,6 @@ #!/bin/bash -curl --include --request POST http://localhost:3000/sign-up \ +curl --include --request POST http://localhost:4741/sign-up \ --header "Content-Type: application/json" \ --data '{ "credentials": { @@ -10,7 +10,7 @@ curl --include --request POST http://localhost:3000/sign-up \ } }' -curl --include --request POST http://localhost:3000/sign-up \ +curl --include --request POST http://localhost:4741/sign-up \ --header "Content-Type: application/json" \ --data '{ "credentials": { diff --git a/scripts/user.sh b/scripts/user.sh index 589a0b6..191b7d7 100755 --- a/scripts/user.sh +++ b/scripts/user.sh @@ -1,4 +1,4 @@ #!/bin/bash -curl --include --request GET http://localhost:3000/users/$ID \ +curl --include --request GET http://localhost:4741/users/$ID \ --header "Authorization: Token token=$TOKEN" diff --git a/scripts/users.sh b/scripts/users.sh index 84b7d79..5790b02 100755 --- a/scripts/users.sh +++ b/scripts/users.sh @@ -1,4 +1,4 @@ #!/bin/bash -curl --include --request GET http://localhost:3000/users \ +curl --include --request GET http://localhost:4741/users \ --header "Authorization: Token token=$TOKEN"