mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Application creation + management via API + settings panel (#3906)
* [feature] Application creation + management via API + settings panel * fix docs links * add errnorows test * use known application as shorter * add comment about side effects
This commit is contained in:
@@ -21,11 +21,14 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
)
|
||||
|
||||
// BasePath is the base path for this api module, excluding the api prefix
|
||||
const BasePath = "/v1/apps"
|
||||
const (
|
||||
BasePath = "/v1/apps"
|
||||
BasePathWithID = BasePath + "/:" + apiutil.IDKey
|
||||
)
|
||||
|
||||
type Module struct {
|
||||
processor *processing.Processor
|
||||
@@ -39,4 +42,7 @@ func New(processor *processing.Processor) *Module {
|
||||
|
||||
func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) {
|
||||
attachHandler(http.MethodPost, BasePath, m.AppsPOSTHandler)
|
||||
attachHandler(http.MethodGet, BasePath, m.AppsGETHandler)
|
||||
attachHandler(http.MethodGet, BasePathWithID, m.AppGETHandler)
|
||||
attachHandler(http.MethodDelete, BasePathWithID, m.AppDELETEHandler)
|
||||
}
|
||||
|
Reference in New Issue
Block a user