diff --git a/backend/internal/http/handlers.go b/backend/internal/http/handlers.go index ce972d4..e3874b1 100644 --- a/backend/internal/http/handlers.go +++ b/backend/internal/http/handlers.go @@ -2,6 +2,7 @@ package httpapi import ( "net/http" + "time" "watch-party-backend/internal/repo" "watch-party-backend/internal/service" @@ -17,6 +18,15 @@ func NewRouter(svc service.EpisodeService) *gin.Engine { c.JSON(http.StatusOK, gin.H{"status": "ok"}) }) + r.GET("/time", func(c *gin.Context) { + now := time.Now().UTC().UnixMilli() + + c.Header("Cache-Control", "no-store, max-age=0, must-revalidate") + c.JSON(http.StatusOK, gin.H{ + "now": now, + }) + }) + v1 := r.Group("/v1") // GET /v1/current