Exemple #1
0
func main() {
	mux := http.NewServeMux()
	// handlers are set seperately
	sshttp.SetMux(*mux)

	n := negroni.Classic()
	n.UseHandler(mux)
	n.Run(":3000")
}
Exemple #2
0
func main() {
	mux := http.NewServeMux()
	// handlers are set seperately
	sshttp.SetMux(*mux)

	n := negroni.Classic()
	n.UseHandler(mux)

	vagrant := flag.Bool("vagrant", false, "If you pass the arg -vagrant the http server starts at 0.0.0.0:3000 so portforwarding works")
	flag.Parse()

	if *vagrant {
		n.Run("0.0.0.0:3000")
	} else {
		n.Run(":3000")
	}

}