mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-14 03:17:27 -06:00
[feature] Add /api/v1/admin/debug/apurl endpoint (#2359)
This commit is contained in:
parent
74700cc803
commit
5eddef6c9b
7 changed files with 367 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ package admin
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"codeberg.org/gruf/go-debug"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
)
|
||||
|
|
@ -46,6 +47,8 @@ const (
|
|||
EmailTestPath = EmailPath + "/test"
|
||||
InstanceRulesPath = BasePath + "/instance/rules"
|
||||
InstanceRulesPathWithID = InstanceRulesPath + "/:" + IDKey
|
||||
DebugPath = BasePath + "/debug"
|
||||
DebugAPUrlPath = DebugPath + "/apurl"
|
||||
|
||||
IDKey = "id"
|
||||
FilterQueryKey = "filter"
|
||||
|
|
@ -116,4 +119,9 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H
|
|||
attachHandler(http.MethodPost, InstanceRulesPath, m.RulePOSTHandler)
|
||||
attachHandler(http.MethodPatch, InstanceRulesPathWithID, m.RulePATCHHandler)
|
||||
attachHandler(http.MethodDelete, InstanceRulesPathWithID, m.RuleDELETEHandler)
|
||||
|
||||
// debug stuff
|
||||
if debug.DEBUG {
|
||||
attachHandler(http.MethodGet, DebugAPUrlPath, m.DebugAPUrlHandler)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue