Exemple #1
0
func BindHandlers(db *sql.DB, mux *mux.Router) {
	mux.HandleFunc("/", WrapHandler(db, UiHome))
	mux.HandleFunc("/auth", WrapHandler(db, UiAuth))
	mux.HandleFunc("/completeAuth", WrapHandler(db, UiCompleteAuth))

	mux.HandleFunc("/water/{user}", WrapHandler(db, UiWater))
	mux.HandleFunc("/water/{user}/{size}", WrapHandler(db, UiAddWater))
}
Exemple #2
0
func routerHandlerFunc(router *mux.Router) http.HandlerFunc {
	return func(res http.ResponseWriter, req *http.Request) {
		router.ServeHTTP(res, req)
	}
}