/.rb Secret
Created
April 26, 2022 15:13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
def hello(event:, context:) | |
begin | |
puts "Received Request: #{event}" | |
{ statusCode: 200, body: JSON.generate("Go Serverless v1.0! Your function executed successfully! #{event['body']}") } | |
rescue StandardError => e | |
puts e.message | |
puts e.backtrace.inspect | |
{ statusCode: 400, body: JSON.generate("Bad request, please POST a request body!") } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment