Created
November 13, 2012 04:01
-
-
Save sanatgersappa/4063850 to your computer and use it in GitHub Desktop.
Go FastCGI app
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" | |
"log" | |
"net" | |
"net/http" | |
"net/http/fcgi" | |
) | |
func main() { | |
l, err := net.Listen("tcp", ":9999") //listen on port 9999 | |
if err != nil { | |
log.Fatal(err) | |
} | |
mux := http.NewServeMux() | |
mux.HandleFunc("/hello", index) | |
fcgi.Serve(l, mux) | |
} | |
func index(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hello from Windows Azure! -- The Gopher") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment