Skip to content

Instantly share code, notes, and snippets.

@pwaller
Last active August 29, 2015 14:03
Show Gist options
  • Save pwaller/78104aaceff8ad628149 to your computer and use it in GitHub Desktop.
Save pwaller/78104aaceff8ad628149 to your computer and use it in GitHub Desktop.
go CGI demo
package main
import (
"fmt"
"net/http"
"net/http/cgi"
)
func Handler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintln(w, "Served up a request")
}
func main() {
cgi.Serve(http.HandlerFunc(Handler))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment