MCPcopy
hub / github.com/usefathom/fathom / GetAggregatedPageStatsHandler

Method GetAggregatedPageStatsHandler

pkg/api/page_stats.go:8–15  ·  view source on GitHub ↗

URL: /api/sites/{id:[0-9]+}/stats/pages/agg

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

6
7// URL: /api/sites/{id:[0-9]+}/stats/pages/agg
8func (api *API) GetAggregatedPageStatsHandler(w http.ResponseWriter, r *http.Request) error {
9 params := GetRequestParams(r)
10 result, err := api.database.SelectAggregatedPageStats(params.SiteID, params.StartDate, params.EndDate, params.Offset, params.Limit)
11 if err != nil {
12 return err
13 }
14 return respond(w, http.StatusOK, envelope{Data: result})
15}
16
17func (api *API) GetAggregatedPageStatsPageviewsHandler(w http.ResponseWriter, r *http.Request) error {
18 params := GetRequestParams(r)

Callers

nothing calls this directly

Calls 3

GetRequestParamsFunction · 0.85
respondFunction · 0.85

Tested by

no test coverage detected