gohttpserver/internal/handlers/handlenow.go
sneak 75442d261d
Some checks failed
continuous-integration/drone/push Build is failing
this is nowhere near working yet
2022-11-28 04:59:20 +01:00

16 lines
271 B
Go

package handlers
import (
"net/http"
"time"
)
func (s *Handlers) HandleNow() http.HandlerFunc {
type response struct {
Now time.Time `json:"now"`
}
return func(w http.ResponseWriter, r *http.Request) {
s.respondJSON(w, r, &response{Now: time.Now()}, 200)
}
}