Skip to content

Commit

Permalink
Show image by remote
Browse files Browse the repository at this point in the history
とりあえず手元で画像が出るだけ出て欲しい
  • Loading branch information
rosylilly committed Sep 8, 2019
1 parent eefb8d0 commit c9248d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions webapp/ruby/lib/isucari/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ def get_shipment_service_url
get_config_by_name('shipment_service_url') || DEFAULT_SHIPMENT_SERVICE_URL
end

def get_image_url(image_name)
"/upload/#{image_name}"
if ENV['LOCAL']
def get_image_url(image_name)
"https://isucon9.catatsuy.org/upload/#{image_name}"
end
else
def get_image_url(image_name)
"/upload/#{image_name}"
end
end

def body_params
Expand Down Expand Up @@ -1195,7 +1201,7 @@ def halt_with_error(status = 500, error = 'unknown')
# getReports
get '/reports.json' do
transaction_evidences = db.xquery('SELECT * FROM `transaction_evidences` WHERE `id` > 15007')

response = transaction_evidences.map do |transaction_evidence|
{
'id' => transaction_evidence['id'],
Expand Down

0 comments on commit c9248d4

Please sign in to comment.