From 25b14fea037c9145e0ddc416ffc479d8fc784471 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Wed, 19 Jun 2024 15:50:57 -0700 Subject: [PATCH] Migrate action routes to /api --- server/server.go | 8 +++++--- web/pages/index.html | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/server.go b/server/server.go index ff3f75b..f91c342 100644 --- a/server/server.go +++ b/server/server.go @@ -39,9 +39,11 @@ func New(deps Dependencies) *Server { r.Get("/", s.handleIndex) r.Get("/dosages.json", s.getDosagesJSON) - r.Post("/notify/test", s.handleGotifyTest) - r.Post("/dosage/record", s.handleRecordDosage) - r.Post("/dosage/delete", s.handleDeleteDosage) + r.Route("/api", func(r chi.Router) { + r.Post("/notify/test", s.handleGotifyTest) + r.Post("/dosage/record", s.handleRecordDosage) + r.Post("/dosage/delete", s.handleDeleteDosage) + }) r.Route("/static", func(r chi.Router) { r.Use(middleware.Compress(5)) diff --git a/web/pages/index.html b/web/pages/index.html index e367b4f..dd8cc47 100644 --- a/web/pages/index.html +++ b/web/pages/index.html @@ -48,14 +48,14 @@

hrtclicker

-