Skip to content

Commit 2d012df

Browse files
committed
added database connection
1 parent b87d0f7 commit 2d012df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
require './data/dragon.rb'
1414

1515
# DB Connection initiated
16-
16+
DB = Mysql2::Client.new(:host => "wvulqmhjj9tbtc1w.cbetxkdyhwsb.us-east-1.rds.amazonaws.com", :username => "ofyslai9g5zjznpq")
1717

1818
# Disables rack protection because of false positives
1919
# that were blocking connections to home page
@@ -29,6 +29,8 @@
2929
subdomain :api do
3030

3131
get '/' do
32+
results = client.query("SELECT * FROM launches")
33+
results.count
3234
end
3335

3436
get '/info' do

0 commit comments

Comments
 (0)