Method: Jets::Controller::Base#process!

Defined in:
lib/jets/controller/base.rb

#process!Object

One key difference between process! vs dispatch!

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

Most of the time, you want process! instead of dispatch!



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/jets/controller/base.rb', line 45

def process!
  adapter = Jets::Controller::Rack::Adapter.new(event, context, meth)
  adapter.rack_vars(
    'jets.controller' => self,
    'lambda.context' => context,
    'lambda.event' => event,
    'lambda.meth' => meth,
  )

  # adapter.process calls
  #
  #     Jets.application.call(env)
  #
  # and that goes through the middleware stacks. The last middleware stack is Jets::Controller::Middleware::Main
  #
  #     class Jets::Controller::Middleware::Main
  #       def call!
  #         setup
  #         @controller.dispatch! # Returns triplet
  #       end
  #     end
  #
  adapter.process # Returns API Gateway hash structure
end