From e227284177b385227931d0b4fe852303daf52ccf Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Tue, 25 Mar 2025 00:09:53 +0000 Subject: [PATCH] Prefix api with '/api/v1' --- api/api.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/api.go b/api/api.go index dfbbaf4..129d95e 100644 --- a/api/api.go +++ b/api/api.go @@ -39,7 +39,7 @@ func New(upload *upload.Handler, keyStore *mjwt.KeyStore, db apiDB) *httprouter. }) // Site creation endpoint - router.PUT("/sites/:host", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { + router.PUT("/api/v1/sites/:host", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { host := params.ByName("host") if !validation.IsValidSite(host) { @@ -74,7 +74,7 @@ func New(upload *upload.Handler, keyStore *mjwt.KeyStore, db apiDB) *httprouter. })) // Reset site token endpoint - router.POST("/sites/:host/reset-token", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { + router.POST("/api/v1/sites/:host/reset-token", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { host := params.ByName("host") if !validation.IsValidSite(host) { @@ -109,10 +109,10 @@ func New(upload *upload.Handler, keyStore *mjwt.KeyStore, db apiDB) *httprouter. })) // Enable/disable site branch - router.PUT("/sites/:host/:branch/enable", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { + router.PUT("/api/v1/sites/:host/:branch/enable", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { setEnabled(rw, req, params, b, db, true) })) - router.DELETE("/sites/:host/:branch/enable", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { + router.DELETE("/api/v1/sites/:host/:branch/enable", checkAuth(keyStore, func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) { setEnabled(rw, req, params, b, db, false) }))