example/basic_auth.go
func main() {
	router := r2router.NewSeeforRouter()
	
	// basic auth for entire router
	router.Before(httpauth.SimpleBasicAuth("testuser", "testpw"))
	
	router.Get("/hello/:name", func(w http.ResponseWriter, r *http.Request, p r2router.Params) {
		w.Write([]byte( p.Get("name")))
	})

	http.ListenAndServe("127.0.0.1:8080", router)
}
func main() {
	router := r2router.NewSeeforRouter()
	
	// basic auth for entire router
	router.Before(httpauth.SimpleBasicAuth("testuser", "testpw"))
	
	router.Get("/hello/:name", func(w http.ResponseWriter, r *http.Request, p r2router.Params) {
		w.Write([]byte( p.Get("name")))
	})

	http.ListenAndServe("127.0.0.1:8080", router)
}
func main ( ) { router := r2router . NewSeeforRouter ( ) // basic auth for entire router router . Before ( httpauth . SimpleBasicAuth ( " " , " " ) ) router . Get ( " " , func ( w http . ResponseWriter , r * http . Request , p r2router . Params ) { w . Write ( [ ] byte ( p . Get ( " " ) ) ) } ) http . ListenAndServe ( " " , router ) }
// Example how to use basic auth together with r2router
Example how to use basic auth together with r2router