Add Current endpoint
continuous-integration/drone/push Build is passing Details

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
1 changed files with 1 additions and 0 deletions

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")]