templates/crystal/example/src/handler.cr in faastruby-0.4.1 vs templates/crystal/example/src/handler.cr in faastruby-0.4.2
- old
+ new
@@ -6,11 +6,10 @@
def handler(event : FaaStRuby::Event) : FaaStRuby::Response
# event.body : String | Nil
# event.headers : Hash(String, String)
# event.context : String | Nil
# query_params : Hash(String, String)
- name = event.body ? JSON.parse(event.body.not_nil!)["name"] : "World"
# FUNCTION RESPONSE
#
# You can render text, json, yaml, html or js. Example:
# render html: "<p>Hello World!</p>"
# render yaml: {"hello" => "world!"}
@@ -21,7 +20,7 @@
#
# Headers:
# The 'Content-Type' header is automatically set when you use 'render'.
# You can set custom headers using a Hash(String, String). Example:
# render text: "It Works!", headers: {"TransactionId" => 23928}
- render text: "Hello, #{name}!\n"
+ render text: "Hello, World!\n"
end