Skip to content

Instantly share code, notes, and snippets.

@codegangsta
Created July 25, 2014 04:07
Show Gist options
  • Save codegangsta/372cf4738765295fef7f to your computer and use it in GitHub Desktop.
Save codegangsta/372cf4738765295fef7f to your computer and use it in GitHub Desktop.
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