Module: Jets::Controller::Handler

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/jets/controller/handler.rb,
lib/jets/controller/handler/apigw.rb

Overview

Also, logic in the opposite direction: Jets::Controller::Middleware::Mimic::Apigw Only called by AWS Lambda before it runs through the middlewares.

Defined Under Namespace

Classes: Apigw

Instance Method Summary collapse

Instance Method Details

#process!Object

One key difference between process! vs dispatch!

process! - takes the request through the middleware stack
dispatch! - does not

Generally, we want to use process! so it goes through the middleware stacks.

The last middleware stack is Jets::Controller::Middleware::Main Which comes back to dispatch! in this same Controller Base class.

class Jets::Controller::Middleware::Main
  def call!
    setup
    @controller.dispatch! # Returns triplet
  end
end


23
24
25
26
# File 'lib/jets/controller/handler.rb', line 23

def process!
  apigw = Jets::Controller::Handler::Apigw.new(event, context, self, @meth, @rack_env)
  apigw.process_through_middlewares # Returns API Gateway hash structure
end