Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (19 sloc) 512 Bytes
load "vendor/bundle/bundler/setup.rb"
require 'json'
require './lib/resize_image'
def call(event:, context:)
begin
size = event["pathParameters"]["size"]
image = event["pathParameters"]["image"]
resized_image_url = ResizeImage.new(image, size).call
{
headers: { location: resized_image_url },
statusCode: 301,
body: ''
}
rescue StandardError => e
puts e.message
puts e.backtrace.inspect
{ statusCode: 400, body: JSON.generate(e.message) }
end
end
You can’t perform that action at this time.