Hummingbird running inside an AWS Lambda

What's New

v1.0.0 Release Candidate 6


Patch fixes

  • Use rawStringQuery from APIGatewayV2 event to build query values

Hummingbird Lambda

Run Hummingbird inside an AWS Lambda


Create struct conforming to LambdaFunction. Setup your application in the init function: add your middleware, add route handlers etc

struct MyHandler: LambdaFunction {
    // define input and output
    typealias Event = APIGatewayRequest
    typealias Output = APIGatewayResponse
    typealias Context = BasicLambdaRequestContext<APIGatewayRequest>
    init(_ app: Application) {
        app.router.get("hello") { _, _ in
            return "Hello"

The Event and Output types define your input and output objects. If you are using an APIGateway REST interface to invoke your Lambda then set these to APIGatewayRequest and APIGatewayResponse respectively. If you are using an APIGateway HTML interface then set these to APIGatewayV2Request and APIGatewayV2Response. If you are using any other Event/Output types you will need to implement the request(context:application:from:) and output(from:) methods yourself.


  • Swift Tools 5.9.0
View More Packages from this Author


Last updated: Wed May 29 2024 06:43:48 GMT-0900 (Hawaii-Aleutian Daylight Time)