Skip to content

Commit

Permalink
fix GET method
Browse files Browse the repository at this point in the history
  • Loading branch information
JCL38-ORANGE committed Jan 17, 2023
1 parent 526ea62 commit 9140fa0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/sinatra_app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@
get '/service/mysql/:service_name/:key' do
client = load_mysql(params[:service_name])
query = client.query("select data_value from data_values where id = '#{params[:key]}'")
value = query.first['data_value'] rescue nil
#value = query.first['data_value'] rescue nil
value = query.first['data_value']
client.close
value
#value
end

post '/service/mysql/:service_name/:key' do
Expand Down

0 comments on commit 9140fa0

Please sign in to comment.