Created
July 25, 2014 04:07
-
-
Save codegangsta/372cf4738765295fef7f to your computer and use it in GitHub Desktop.
This file contains 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 ( | |
"flag" | |
"net/http" | |
"github.com/codegangsta/negroni" | |
) | |
func main() { | |
host := flag.String("http", ":8080", "http host:port to listen on") | |
flag.Parse() | |
n := negroni.Classic() | |
mux := http.NewServeMux() | |
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
w.Write([]byte("Hello Gophercasts!")) | |
}) | |
n.UseHandler(mux) | |
n.Run(*host) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment