mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 11:30:28 +00:00
17 lines
380 B
Go
17 lines
380 B
Go
package api
|
|
|
|
import (
|
|
"github.com/usefathom/fathom/pkg/count"
|
|
"net/http"
|
|
)
|
|
|
|
// URL: /api/browsers
|
|
var GetBrowsersHandler = HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
|
before, after := getRequestedPeriods(r)
|
|
results, err := count.Browsers(before, after, getRequestedLimit(r))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return respond(w, envelope{Data: results})
|
|
})
|