From cb30b2a87f5715f487fb16c81313cbdd414031f8 Mon Sep 17 00:00:00 2001 From: Matt Gleich Date: Sun, 29 Dec 2024 03:19:33 -0500 Subject: [PATCH] feat: remove cache path from endpoint Signed-off-by: Matt Gleich --- internal/apis/applemusic/applemusic.go | 4 ++-- internal/apis/github/github.go | 4 ++-- internal/apis/steam/steam.go | 4 ++-- internal/apis/strava/strava.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/apis/applemusic/applemusic.go b/internal/apis/applemusic/applemusic.go index 821275a..87ae163 100644 --- a/internal/apis/applemusic/applemusic.go +++ b/internal/apis/applemusic/applemusic.go @@ -59,8 +59,8 @@ func Setup(router *chi.Mux) { } applemusicCache := cache.New("applemusic", data) - router.Get("/applemusic/cache", applemusicCache.ServeHTTP()) - router.Handle("/applemusic/cache/ws", applemusicCache.ServeWS()) + router.Get("/applemusic", applemusicCache.ServeHTTP()) + router.Handle("/applemusic/ws", applemusicCache.ServeWS()) go applemusicCache.UpdatePeriodically(cacheUpdate, 30*time.Second) lumber.Done("setup apple music cache") } diff --git a/internal/apis/github/github.go b/internal/apis/github/github.go index b1bf68c..894a9fb 100644 --- a/internal/apis/github/github.go +++ b/internal/apis/github/github.go @@ -25,8 +25,8 @@ func Setup(router *chi.Mux) { } githubCache := cache.New("github", pinnedRepos) - router.Get("/github/cache", githubCache.ServeHTTP()) - router.Handle("/github/cache/ws", githubCache.ServeWS()) + router.Get("/github", githubCache.ServeHTTP()) + router.Handle("/github/ws", githubCache.ServeWS()) go githubCache.UpdatePeriodically( func() ([]repository, error) { return fetchPinnedRepos(githubClient) }, 2*time.Minute, diff --git a/internal/apis/steam/steam.go b/internal/apis/steam/steam.go index d8e3454..249bcd1 100644 --- a/internal/apis/steam/steam.go +++ b/internal/apis/steam/steam.go @@ -15,8 +15,8 @@ func Setup(router *chi.Mux) { } steamCache := cache.New("steam", games) - router.Get("/steam/cache", steamCache.ServeHTTP()) - router.Handle("/steam/cache/ws", steamCache.ServeWS()) + router.Get("/steam", steamCache.ServeHTTP()) + router.Handle("/steam/ws", steamCache.ServeWS()) go steamCache.UpdatePeriodically(fetchRecentlyPlayedGames, 5*time.Minute) lumber.Done("setup steam cache") } diff --git a/internal/apis/strava/strava.go b/internal/apis/strava/strava.go index 6851c17..5a6965e 100644 --- a/internal/apis/strava/strava.go +++ b/internal/apis/strava/strava.go @@ -28,8 +28,8 @@ func Setup(router *chi.Mux) { lumber.ErrorMsg("failed to load initial data for strava cache; not updating") } stravaCache := cache.New("strava", stravaActivities) - router.Get("/strava/cache", stravaCache.ServeHTTP()) - router.Handle("/strava/cache/ws", stravaCache.ServeWS()) + router.Get("/strava", stravaCache.ServeHTTP()) + router.Handle("/strava/ws", stravaCache.ServeWS()) router.Post("/strava/event", eventRoute(stravaCache, *minioClient, stravaTokens)) router.Get("/strava/event", challengeRoute)