Skip to content

Instantly share code, notes, and snippets.

@sanatgersappa
Created November 13, 2012 04:01
Show Gist options
  • Save sanatgersappa/4063850 to your computer and use it in GitHub Desktop.
Save sanatgersappa/4063850 to your computer and use it in GitHub Desktop.
Go FastCGI app
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