• Function

    helloHandler

    Sample AWS Lambda handler for API Gateway HTTP API (v2) events. Accepts HTTP GET requests with optional path or query parameters to customize the greeting recipient. Returns a JSON response with greeting, request metadata, and input resolution details.

    Supported invocation patterns:

    • GET /hello — greeting with default name "world"
    • GET /hello/{name} — greeting with path parameter
    • GET /hello?name=value — greeting with query parameter

    Returns

    HTTP response with 200 status and JSON body

    Example

    // Invoked via API Gateway
    const response = await helloHandler(
    {
    pathParameters: { name: 'Bayu' },
    queryStringParameters: {}
    } as APIGatewayProxyEventV2,
    context
    );
    // Returns: { statusCode: 200, headers: {...}, body: '{"message":"Hello, Bayu!","..." }' }

    Author

    Bayu Dwiyan Satria

    Since

    1.0.0

    See

    Parameters

    • event: APIGatewayProxyEventV2

      API Gateway HTTP API v2 event payload

    • context: Context

      Lambda invocation context

    Returns Promise<APIGatewayProxyStructuredResultV2>

Generated using TypeDoc