Sha256: 5833ca80500a46369e2539f6cb227aa83efed2590217046b30c1a033e97710f0

Contents?: true

Size: 921 Bytes

Versions: 45

Compression:

Stored size: 921 Bytes

Contents

# require "cool-shard"
require "json"

# To deploy this function, cd into its folder and run:
# faastruby deploy-to WORKSPACE_NAME
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)
  # FUNCTION RESPONSE
  #
  # You can render text, json, yaml, html or js. Example:
  # render html: "<p>Hello World!</p>"
  # render yaml: {"hello" => "world!"}
  #
  # Status:
  # The default status is 200. You can set a custom status like this:
  # render json: {"error" => "Could not perform the action"}, status: 422
  #
  # 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, World!\n"
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
faastruby-0.5.29 templates/crystal/example/src/handler.cr
faastruby-0.5.28 templates/crystal/example/src/handler.cr
faastruby-0.5.27 templates/crystal/example/src/handler.cr
faastruby-0.5.26 templates/crystal/example/src/handler.cr
faastruby-0.5.25 templates/crystal/example/src/handler.cr
faastruby-0.5.24 templates/crystal/example/src/handler.cr
faastruby-0.5.23 templates/crystal/example/src/handler.cr
faastruby-0.5.22 templates/crystal/example/src/handler.cr
faastruby-0.5.21 templates/crystal/example/src/handler.cr
faastruby-0.5.20 templates/crystal/example/src/handler.cr
faastruby-0.5.19 templates/crystal/example/src/handler.cr
faastruby-0.5.18 templates/crystal/example/src/handler.cr
faastruby-0.5.17 templates/crystal/example/src/handler.cr
faastruby-0.5.16 templates/crystal/example/src/handler.cr
faastruby-0.5.15 templates/crystal/example/src/handler.cr
faastruby-0.5.14 templates/crystal/example/src/handler.cr
faastruby-0.5.13 templates/crystal/example/src/handler.cr
faastruby-0.5.12 templates/crystal/example/src/handler.cr
faastruby-0.5.11 templates/crystal/example/src/handler.cr
faastruby-0.5.10 templates/crystal/example/src/handler.cr