Class: Lamby::ProxyServer

Inherits:
Object
  • Object
show all
Defined in:
lib/lamby/proxy_server.rb

Constant Summary collapse

METHOD_NOT_ALLOWED =
"  <h1>Method Not Allowed</h1>\n  <p>Please POST to this endpoint with an application/json content type and JSON payload of your Lambda's event and context.<p>\n  <p>Example: <code>{ \"event\": event, \"context\": context }</code></p>\n".strip

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
# File 'lib/lamby/proxy_server.rb', line 10

def call(env)
  return method_not_allowed unless method_allowed?(env)
  event, context = event_and_context(env)
  lambda_to_rack Lamby.cmd(event: event, context: context)
end