gohttpserver/internal/server/handlers.go
Jeffrey Paul 61228b4586
Some checks failed
continuous-integration/drone/push Build is failing
embed static files now (#14)
Co-authored-by: sneak <sneak@sneak.berlin>
Reviewed-on: #14
2022-11-28 00:19:47 +00:00

16 lines
267 B
Go

package server
import (
"net/http"
"time"
)
func (s *server) 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)
}
}