Exemplo n.º 1
0
func main() {
	homeHandler := http.HandlerFunc(home)

	// Adding Minify middleware
	// Note: If you use any Gzip middleware, add Minify middleware after that
	http.Handle("/", middleware.Minify(homeHandler))

	log.Println("Starting server at localhost:8000")
	http.ListenAndServe(":8000", nil)
}
Exemplo n.º 2
0
func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", negroniHome)

	n := negroni.Classic()

	// Adding Minify middleware
	n.UseHandler(middleware.Minify(mux))

	n.Run(":8000")
}