Sha256: 2fe030580e96a9a393a83ca2711850bb513f132af15d275ee4b04572fe7e8543

Contents?: true

Size: 924 Bytes

Versions: 48

Compression:

Stored size: 924 Bytes

Contents

# require 'cool-gem'

# To deploy this function, cd into its folder and run:
# faastruby deploy-to WORKSPACE_NAME
def handler event
  # The 'event' argument has the following attributes
  # event.body - The request body
  # event.context - The execution context
  # event.headers - The request headers
  # event.query_params - The query params

  # 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 with string keys. Example:
  # render text: 'It Works!', headers: {'TransactionId' => 23928}
  render text: "Hello, World!\n"
end

Version data entries

48 entries across 48 versions & 1 rubygems

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