func main() { mux := yam.New() mux.Route("/").Get(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello World!")) })) http.ListenAndServe(":5000", mux) }
func main() { mux := yam.New() mux.Route("/").Get(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello World!")) })) mux.Route("/foo").Get(RouteOnly(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello World!")) }))) http.ListenAndServe(":5000", GlobalMiddleware(mux)) }