(version string)
| 49 | } |
| 50 | |
| 51 | func apiVersionCtx(version string) func(next http.Handler) http.Handler { |
| 52 | return func(next http.Handler) http.Handler { |
| 53 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 54 | r = r.WithContext(context.WithValue(r.Context(), "api.version", version)) |
| 55 | next.ServeHTTP(w, r) |
| 56 | }) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func articleRouter() http.Handler { |
| 61 | r := chi.NewRouter() |
no test coverage detected