Create a gist now

Instantly share code, notes, and snippets.

@tj /main.go
Last active Mar 23, 2017

package main
import (
func main() {
h := http.NewServeMux()
h.HandleFunc("/hello", hello)
h.HandleFunc("/world", world)
func hello(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello")
func world(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "World")
tj commented Mar 15, 2017 edited

Lets you run regular net/http servers on AWS API Gateway via with just apex.Handle(proxy.Serve(h)), or apex.Handle(proxy.Serve(nil)) for DefaultServeMux, otherwise everything else is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment