Example #1
0
func CountHandler(store kv.Store) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

		id := getId(r.URL.Path)

		switch r.Method {
		case exercise.GET:
			{
				v := store.Count(id)
				w.Write([]byte(strconv.Itoa(v)))
			}

		}
	})
}