2016-11-24 14:18:40 +01:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2016-12-11 14:50:01 +01:00
|
|
|
"net/http"
|
2016-12-23 16:49:23 +02:00
|
|
|
|
2018-04-24 10:28:23 +02:00
|
|
|
"github.com/usefathom/fathom/pkg/count"
|
2016-11-24 14:18:40 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// URL: /api/screen-resolutions
|
|
|
|
var GetScreenResolutionsHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
2016-12-11 14:50:01 +01:00
|
|
|
before, after := getRequestedPeriods(r)
|
2016-12-24 15:11:15 +02:00
|
|
|
results := count.Screens(before, after, getRequestedLimit(r))
|
2017-01-13 12:46:54 +01:00
|
|
|
respond(w, envelope{Data: results})
|
2016-11-24 14:18:40 +01:00
|
|
|
})
|