Sha256: 212dcd6a181a2aa4c66ff536b959201b050a743803d7bea7e00d82682cbad5cc

Contents?: true

Size: 577 Bytes

Versions: 15

Compression:

Stored size: 577 Bytes

Contents

require "bundler/setup"
require "jets"
Jets.once  # runs once in lambda execution context

<% @vars.functions.each do |function_name|
  handler = @vars.handler_for(function_name)
  meth = handler.split('.').last
-%>
def <%= meth -%>(event:, context:)
<% if @vars.process_type == "controller" -%>
  if Jets.config.cfn.build.routes == "one_apigw_method_for_all_routes"
    route = Jets::Router.find_route_by_event(event)
    event["pathParameters"] = route.rebuild_path_parameters(event) # override
  end
<% end -%>
  Jets.process(event, context, "<%= handler -%>")
end
<% end %>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.12 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.11 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.10 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.9 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.8 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.7 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.6 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.5 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.4 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.3 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.2 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.1 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.0 lib/jets/builders/templates/handlers/one_lambda_per_method.rb
jets-5.0.0.beta1 lib/jets/builders/templates/handlers/one_lambda_per_method.rb