Пример #1
0
func registRouter(app *app.App) {
	app.Use(mount.New("/v1", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
		resp.Write([]byte("/v1"))
	})))
	app.Get("/", http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
		resp.Write([]byte("ok"))
	}))

	app.Get("/debug/_gom", gomhttp.Handler())
}
Пример #2
0
func Example_gorillaMux() {
	mux := http.NewServeMux()
	mux.HandleFunc("/debug/_gom", gomhttp.Handler())
	log.Println(http.ListenAndServe("localhost:6060", nil))
}