2022-11-28 00:19:47 +00:00
|
|
|
package server
|
2020-10-05 13:15:32 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|