package web import ( "fmt" "net/http" "gitlab.com/whom/bingobot/internal/activity" "gitlab.com/whom/bingobot/internal/config" "gitlab.com/whom/bingobot/internal/logging" ) func Start() error { frag := config.Get().LocalWebEndpointListen http.HandleFunc("/", HandleHttpRequest) go logging.Error(http.ListenAndServe(frag, nil).Error()) logging.Debug("Web handlers started") return nil } func HandleHttpRequest(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "") fmt.Fprintf(w, "
number of the last %d days a user has been active
", config.Get().UserEventLifespanDays) fmt.Fprintf(w, "| User | Days |
|---|---|
| %s | %d |