Class: Lamby::ProxyServer

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

Constant Summary collapse

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

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