gohttpserver/internal/handlers/now.go
Jeffrey Paul dd778174a7
Some checks failed
continuous-integration/drone/push Build is failing
sneak/integrate-di (#17)
moving this to use uber/fx di framework instead of the ad hoc di setup before

Co-authored-by: sneak <sneak@sneak.berlin>
Reviewed-on: #17
2023-01-29 03:06:05 +00: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)
}
}