Last active
August 29, 2015 14:03
-
-
Save pwaller/78104aaceff8ad628149 to your computer and use it in GitHub Desktop.
go CGI demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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