All Projects → fujiwara → Ridge

fujiwara / Ridge

Licence: mit
AWS Lambda HTTP Proxy integration event bridge to Go net/http.

Programming Languages

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

Projects that are alternatives of or similar to Ridge

Node Lambda Log
Basic logging mechanism for Node 6.10+ Lambda Functions
Stars: ✭ 115 (+155.56%)
Mutual labels:  aws, lambda, apex
Aws Serverless Workshop Innovator Island
Welcome to the Innovator Island serverless workshop! This repo contains all the instructions and code you need to complete the workshop. Questions? Contact @jbesw.
Stars: ✭ 363 (+706.67%)
Mutual labels:  aws, lambda, apigateway
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+1013.33%)
Mutual labels:  aws, lambda, apigateway
Aws Lambda Resize Images
AWS Lambda function to generate a set of resized images (large, medium, small)
Stars: ✭ 6 (-86.67%)
Mutual labels:  aws, lambda
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+18817.78%)
Mutual labels:  aws, lambda
Serverless Plugin Warmup
Keep your lambdas warm during winter. ♨
Stars: ✭ 814 (+1708.89%)
Mutual labels:  aws, lambda
Archive aws Lambda Go
A fast and clean way to execute Go on AWS Lambda.
Stars: ✭ 710 (+1477.78%)
Mutual labels:  aws, lambda
Github To S3 Lambda Deployer
⚓️ GitHub webhook extension for uploading static pages to AWS S3 directly after commiting to master via Lambda written in Node.js
Stars: ✭ 23 (-48.89%)
Mutual labels:  aws, lambda
Lambdalogs
A CLI tool to trace AWS Lambda calls over multiple CloudWatch log groups.
Stars: ✭ 18 (-60%)
Mutual labels:  aws, lambda
Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-44.44%)
Mutual labels:  aws, lambda
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-40%)
Mutual labels:  aws, lambda
Archive aws Lambda Go Shim
Author your AWS Lambda functions in Go, effectively.
Stars: ✭ 799 (+1675.56%)
Mutual labels:  aws, lambda
Dawson Cli
A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
Stars: ✭ 721 (+1502.22%)
Mutual labels:  aws, lambda
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+1728.89%)
Mutual labels:  aws, lambda
Lambda Packages
Various popular python libraries, pre-compiled to be compatible with AWS Lambda
Stars: ✭ 713 (+1484.44%)
Mutual labels:  aws, lambda
Aws Lambda Workshop
Some incremental examples suitable to host an AWS Lambda Functions workshop
Stars: ✭ 18 (-60%)
Mutual labels:  aws, lambda
Lambda Proxy Router
A simple router for AWS Lambda Proxy Functions
Stars: ✭ 14 (-68.89%)
Mutual labels:  aws, lambda
Serverless Plugin Stackstorm
Plugin for serverless framework to run ready to use actions from StackStorm Exchange as AWS Lambda.
Stars: ✭ 28 (-37.78%)
Mutual labels:  aws, lambda
Aws Iot Button
Stars: ✭ 37 (-17.78%)
Mutual labels:  aws, lambda
Aws Sam Cli
CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
Stars: ✭ 5,817 (+12826.67%)
Mutual labels:  aws, lambda

ridge

AWS Lambda HTTP Proxy integration event bridge to Go net/http.

Example

ridge is a bridge to convert API Gateway with Lambda Proxy Integration request/response and net/http.Request and net/http.ResponseWriter.

  • API Gateway with Lambda Proxy Integration through a Proxy Resource
package main

import (
	"fmt"
	"net/http"

	"github.com/fujiwara/ridge"
)

func main() {
	var mux = http.NewServeMux()
	mux.HandleFunc("/", handleRoot)
	mux.HandleFunc("/hello", handleHello)
	ridge.Run(":8080", "/", mux)
}

func handleHello(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "text/plain")
	fmt.Fprintf(w, "Hello %s\n", r.FormValue("name"))
}

func handleRoot(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "text/plain")
	fmt.Fprintln(w, "Hello World")
	fmt.Fprintln(w, r.URL)
}
  1. Create IAM role "ridge" for Lambda which have attached policy AWSLambdaBasicExecutionRole.
  2. Install lambroll.
  3. Place main.go to example/.
  4. Run make deploy to deploy a lambda function.
  5. Create API Gateway with the lambda function.

ridge.Run(address, prefix, handler)

ridge.Run(address, prefix, handler) works as below.

  • If a process is running on Lambda (AWS_EXECUTION_ENV or AWS_LAMBDA_RUNTIME_API environment variable defined),
    • Call lambda.Start()
  • Otherwise start a net/http server using prefix and address.

LICENSE

The MIT License (MIT)

Copyright (c) 2016- FUJIWARA Shunichiro

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