Coder Social home page Coder Social logo

nicktrienensfuzz / hummingbird-lambda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hummingbird-project/hummingbird-lambda

0.0 0.0 0.0 68 KB

Hummingbird running inside an AWS Lambda

License: Apache License 2.0

Shell 21.14% Swift 77.78% Dockerfile 1.09%

hummingbird-lambda's Introduction

Hummingbird Lambda

Run Hummingbird inside an AWS Lambda

Usage

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

@main
struct MyHandler: HBLambda {
    // define input and output
    typealias Event = APIGatewayRequest
    typealias Output = APIGatewayResponse
    
    init(_ app: HBApplication) {
        app.middleware.add(HBLogRequestsMiddleware(.debug))
        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.

hummingbird-lambda's People

Contributors

adam-fowler avatar nicktrienensfuzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.