A Jets controller handles a web request and renders a response. Here’s an example:


class PostsController < ApplicationController
  def index
    # renders Lambda Proxy structure compatible with API Gateway
    render json: {hello: "world", action: "index"}

  def show
    id = params[:id] # params available
    # puts goes to the lambda logs
    puts event # raw lambda event available
    render json: {action: "show", id: id}

Helper methods like params provide transparent access to the request parameters encoded in the API Gateway event. The render method automatically adapts the response to the Lambda Proxy structure that API Gateway understands.

For each public method in your controller, Jets creates a distinct Lambda function:

Screenshot of Lambda functions generated by public methods in AWS Console