Add Current endpoint
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kekskurse 2022-01-14 22:57:29 +01:00
parent 578b198cb8
commit 016cda5beb
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4

View file

@ -49,6 +49,7 @@ func main() {
func runHttpServer() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
w.Write([]byte("<h1>Time Tracking</h1>"))
w.Write([]byte("Doing "+lastEvent.Name+" since "+lastEvent.EventTimestamp.Format(time.RFC3339)+"<br>"))
w.Write([]byte("<h3>Today</h3>"))
for tag, _ := range currentState {
i := currentState[tag][time.Now().Format("02.01.06")]