All Projects → akrylysov → Algnhsa

akrylysov / Algnhsa

Licence: apache-2.0
AWS Lambda Go net/http server adapter

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Algnhsa

Lambcycle
🐑🛵 A declarative lambda middleware with life cycle hooks 🐑🛵
Stars: ✭ 88 (-61.06%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+1061.5%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Node Lambda Log
Basic logging mechanism for Node 6.10+ Lambda Functions
Stars: ✭ 115 (-49.12%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Node Simple Messaging
Simple email AWS lambda function
Stars: ✭ 75 (-66.81%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (-36.73%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Lambda Refarch Webapp
The Web Application reference architecture is a general-purpose, event-driven, web application back-end that uses AWS Lambda, Amazon API Gateway for its business logic. It also uses Amazon DynamoDB as its database and Amazon Cognito for user management. All static content is hosted using AWS Amplify Console.
Stars: ✭ 1,208 (+434.51%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Aws Lambda Power Tuning
AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.
Stars: ✭ 3,040 (+1245.13%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-77.43%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Spark On Lambda
Apache Spark on AWS Lambda
Stars: ✭ 137 (-39.38%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Aws Lambda List
A list of hopefully useful AWS lambdas and lambda-related resources.
Stars: ✭ 130 (-42.48%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Node Simple Image Resize
Simple image resize AWS lambda function
Stars: ✭ 74 (-67.26%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverlessish
Run the same Docker images in AWS Lambda and AWS ECS
Stars: ✭ 177 (-21.68%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+3634.07%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Aws Serverless Airline Booking
Airline Booking is a sample web application that provides Flight Search, Flight Payment, Flight Booking and Loyalty points including end-to-end testing, GraphQL and CI/CD. This web application was the theme of Build on Serverless Season 2 on AWS Twitch running from April 24th until end of August in 2019.
Stars: ✭ 1,290 (+470.8%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Apex
Old apex/apex
Stars: ✭ 20 (-91.15%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (-47.35%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Plugin Stackstorm
Plugin for serverless framework to run ready to use actions from StackStorm Exchange as AWS Lambda.
Stars: ✭ 28 (-87.61%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+3666.81%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Iopipe Js Core
Observe and develop serverless apps with confidence on AWS Lambda with Tracing, Metrics, Profiling, Monitoring, and more.
Stars: ✭ 123 (-45.58%)
Mutual labels:  aws, serverless, aws-lambda, lambda
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+1217.26%)
Mutual labels:  aws, serverless, aws-lambda, lambda

algnhsa GoDoc Build Status

algnhsa is an AWS Lambda Go net/http server adapter.

algnhsa enables running Go web applications on AWS Lambda and API Gateway or ALB without changing the existing HTTP handlers:

package main

import (
    "fmt"
    "net/http"
    "strconv"

    "github.com/akrylysov/algnhsa"
)

func indexHandler(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("index"))
}

func addHandler(w http.ResponseWriter, r *http.Request) {
    f, _ := strconv.Atoi(r.FormValue("first"))
    s, _ := strconv.Atoi(r.FormValue("second"))
    w.Header().Set("X-Hi", "foo")
    fmt.Fprintf(w, "%d", f+s)
}

func contextHandler(w http.ResponseWriter, r *http.Request) {
    proxyReq, ok := algnhsa.ProxyRequestFromContext(r.Context())
    if ok {
        fmt.Fprint(w, proxyReq.RequestContext.AccountID)
    }
}

func main() {
    http.HandleFunc("/", indexHandler)
    http.HandleFunc("/add", addHandler)
    http.HandleFunc("/context", contextHandler)
    algnhsa.ListenAndServe(http.DefaultServeMux, nil)
}

Plug in a third-party HTTP router

package main

import (
    "net/http"

    "github.com/akrylysov/algnhsa"
    "github.com/go-chi/chi"
)

func main() {
    r := chi.NewRouter()
    r.Get("/", func(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("index"))
    })
    algnhsa.ListenAndServe(r, nil)
}

Setting up API Gateway

  1. Create a new REST API.

  2. In the "Resources" section create a new ANY method to handle requests to / (check "Use Lambda Proxy Integration").

    API Gateway index

  3. Add a catch-all {proxy+} resource to handle requests to every other path (check "Configure as proxy resource").

    API Gateway catch-all

Setting up ALB

  1. Create a new ALB and point it to your Lambda function.

  2. In the target group settings enable "Multi value headers".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].