lib/jets/builders/templates/handler.rb in jets-1.6.7 vs lib/jets/builders/templates/handler.rb in jets-1.6.8
- old
+ new
@@ -1,7 +1,12 @@
require "bundler/setup"
require "jets"
Jets.once # runs once in lambda execution context
-<% @vars.functions.each do |function_name| -%>
-Jets.handler(self, "<%= @vars.handler_for(function_name) %>")
+<% @vars.functions.each do |function_name|
+ handler = @vars.handler_for(function_name)
+ meth = handler.split('.').last
+-%>
+def <%= meth -%>(event:, context:)
+ Jets.process(event, context, "<%= handler -%>")
+end
<% end %>
\ No newline at end of file