All Projects → apex → Gateway

apex / Gateway

Licence: mit
Drop-in replacement for Go net/http when running in AWS Lambda & API Gateway

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Gateway

Chromda
λ 🖼️ Chromda is an AWS Lambda function for capturing screenshots of websites.
Stars: ✭ 481 (-0.62%)
Mutual labels:  serverless, aws-lambda
Mangum
AWS Lambda & API Gateway support for ASGI
Stars: ✭ 475 (-1.86%)
Mutual labels:  serverless, aws-lambda
Serverless Wsgi
Serverless plugin to deploy WSGI applications (Flask/Django/Pyramid etc.) and bundle Python packages
Stars: ✭ 377 (-22.11%)
Mutual labels:  serverless, aws-lambda
Serverless Photo Recognition
A collection of 3 lambda functions that are invoked by Amazon S3 or Amazon API Gateway to analyze uploaded images with Amazon Rekognition and save picture labels to ElasticSearch (written in Kotlin)
Stars: ✭ 345 (-28.72%)
Mutual labels:  serverless, aws-lambda
Serverless Offline
Emulate AWS λ and API Gateway locally when developing your Serverless project
Stars: ✭ 4,330 (+794.63%)
Mutual labels:  serverless, aws-lambda
Midway Faas
🔱 A simple and lightweight serverless framework
Stars: ✭ 363 (-25%)
Mutual labels:  serverless, aws-lambda
Lib
Autocode CLI and standard library tooling
Stars: ✭ 3,773 (+679.55%)
Mutual labels:  serverless, aws-lambda
Serverless Golang
AWS Lambda Go functions using Serverless Framework and Python shim
Stars: ✭ 292 (-39.67%)
Mutual labels:  serverless, aws-lambda
Serverless Express
Run Node.js web applications and APIs using existing application frameworks on AWS #serverless technologies such as Lambda, API Gateway, Lambda@Edge, and ALB.
Stars: ✭ 4,265 (+781.2%)
Mutual labels:  serverless, aws-lambda
Serverless Libreoffice
Run LibreOffice in AWS Lambda to create PDFs & convert documents
Stars: ✭ 410 (-15.29%)
Mutual labels:  serverless, aws-lambda
Express
⚡ Take existing Express.js apps and host them easily on cheap, auto-scaling, serverless infrastructure (AWS Lambda and AWS HTTP API).
Stars: ✭ 337 (-30.37%)
Mutual labels:  serverless, aws-lambda
Webiny Js
Enterprise open-source serverless CMS. Includes a headless CMS, page builder, form builder and file manager. Easy to customize and expand. Deploys to AWS.
Stars: ✭ 4,869 (+905.99%)
Mutual labels:  serverless, aws-lambda
Grant
OAuth Proxy
Stars: ✭ 3,509 (+625%)
Mutual labels:  serverless, aws-lambda
Claudia
Deploy Node.js projects to AWS Lambda and API Gateway easily
Stars: ✭ 3,690 (+662.4%)
Mutual labels:  serverless, aws-lambda
Cljs Lambda
Utilities around deploying Clojurescript functions to AWS Lambda
Stars: ✭ 304 (-37.19%)
Mutual labels:  serverless, aws-lambda
Vandium Node
AWS Lambda framework for building functions using Node.js for API Gateway, IoT applications, and other AWS events.
Stars: ✭ 377 (-22.11%)
Mutual labels:  serverless, aws-lambda
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (-41.53%)
Mutual labels:  serverless, aws-lambda
Hands On Serverless Guide
A hands-on guide for building Serverless applications
Stars: ✭ 288 (-40.5%)
Mutual labels:  serverless, aws-lambda
Serverless Rust
⚡ 🦀 a serverless framework plugin for rustlang applications
Stars: ✭ 386 (-20.25%)
Mutual labels:  serverless, aws-lambda
Guide
Serverless Guide - An open-source definitive guide to serverless architectures.
Stars: ✭ 421 (-13.02%)
Mutual labels:  serverless, aws-lambda

Package gateway provides a drop-in replacement for net/http's ListenAndServe for use in AWS Lambda & API Gateway, simply swap it out for gateway.ListenAndServe. Extracted from Up which provides additional middleware features and operational functionality.

There are two versions of this library, version 1.x supports AWS API Gateway 1.0 events used by the original REST APIs, and 2.x which supports 2.0 events used by the HTTP APIs. For more information on the options read Choosing between HTTP APIs and REST APIs on the AWS documentation website.

Installation

To install version 1.x for REST APIs.

go get github.com/apex/gateway

To install version 2.x for HTTP APIs.

go get github.com/apex/gateway/v2

Example

package main

import (
	"fmt"
	"log"
	"net/http"
	"os"

	"github.com/apex/gateway"
)

func main() {
	http.HandleFunc("/", hello)
	log.Fatal(gateway.ListenAndServe(":3000", nil))
}

func hello(w http.ResponseWriter, r *http.Request) {
	// example retrieving values from the api gateway proxy request context.
	requestContext, ok := gateway.RequestContext(r.Context())
	if !ok || requestContext.Authorizer["sub"] == nil {
		fmt.Fprint(w, "Hello World from Go")
		return
	}

	userID := requestContext.Authorizer["sub"].(string)
	fmt.Fprintf(w, "Hello %s from Go", userID)
}

GoDoc

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].