diff --git a/.ruby-version b/.ruby-version index c043eea..2c9b4ef 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.1 +2.7.3 diff --git a/Gemfile b/Gemfile index 48ec038..e9066dd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' -ruby '2.2.1' +ruby '2.7.3' gem 'sinatra', '~>1.4.4' gem 'thin' +gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index b5714e4..7cfa8e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,8 +3,9 @@ GEM specs: daemons (1.2.2) eventmachine (1.0.7) - rack (1.6.0) - rack-protection (1.5.3) + pg (1.2.3) + rack (1.6.13) + rack-protection (1.5.5) rack sinatra (1.4.6) rack (~> 1.4) @@ -20,5 +21,12 @@ PLATFORMS ruby DEPENDENCIES + pg sinatra (~> 1.4.4) thin + +RUBY VERSION + ruby 2.7.3p183 + +BUNDLED WITH + 2.2.16 diff --git a/web.rb b/web.rb index dbef456..133c0f3 100644 --- a/web.rb +++ b/web.rb @@ -1,5 +1,9 @@ require 'sinatra' +require 'pg' get '/' do - "Hello, world" -end \ No newline at end of file + url = ENV['HEROKU_POSTGRESQL_KBARBER_BLUE_URL'] + conn = PG.connect(url + '?sslmode=verify-full&sslrootcert=/etc/ssl/certs/ca-certificates.crt') + pid = conn.backend_pid + "Hello, world, My pid is #{pid}" +end