From 9140fa0ab71611a1806db78f19f138015a84e726 Mon Sep 17 00:00:00 2001 From: Jean-Christophe LOSAPIO Date: Tue, 17 Jan 2023 15:49:58 +0100 Subject: [PATCH] fix GET method --- assets/sinatra_app/main.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/sinatra_app/main.rb b/assets/sinatra_app/main.rb index 4f6e291..4dc66dd 100644 --- a/assets/sinatra_app/main.rb +++ b/assets/sinatra_app/main.rb @@ -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