imdario / gluo

Write your Go net/http server once, deploy it everywhere (on-premise & AWS Lambda supported)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gluo

Write your HTTP application in Go once, deploy it* to your servers and AWS Lambda. Really, it's a drop-in replacement for net/http.

*: it must be compiled as GOOS=linux to be deployed in AWS Lambda.

Status

Alpha quality. It needs to be tested out extensively but it seems to work fine.

GoDoc GoCard Coverage Status

Installation

go get github.com/imdario/gluo

import (
    "github.com/imdario/gluo"
)

Usage

Just call gluo.ListenAndServe instead of http.ListenAndServe.

package main

import (
        "github.com/imdario/gluo"
        "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("Hello from Gluo"))
}

func main() {
        gluo.ListenAndServe(":3000", http.HandlerFunc(handler))
}

Alternatives

Here are some similar projects, although they don't allow to deploy the same binary to servers and AWS Lambda.

Contact me

If I can help you, you have an idea or you are using Gluo in your projects, don't hesitate to drop me a line (or a pull request): @im_dario

About

Written by Dario Castañé.

License

BSD 3-Clause license.

Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay

About

Write your Go net/http server once, deploy it everywhere (on-premise & AWS Lambda supported)

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%