Skip to content

Instantly share code, notes, and snippets.

@richardgrantserverless
Created April 26, 2022 15:13
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