mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 07:47:29 -06:00
start updating media handler for proper processing
This commit is contained in:
parent
dc338dc881
commit
d797ddf704
5 changed files with 89 additions and 5 deletions
|
|
@ -33,6 +33,10 @@ import (
|
|||
|
||||
// BasePath is the base API path for making media requests
|
||||
const BasePath = "/api/v1/media"
|
||||
// IDKey is the key for media attachment IDs
|
||||
const IDKey = "id"
|
||||
// BasePathWithID corresponds to a media attachment with the given ID
|
||||
const BasePathWithID = BasePath + "/:" + IDKey
|
||||
|
||||
// Module implements the ClientAPIModule interface for media
|
||||
type Module struct {
|
||||
|
|
@ -53,6 +57,7 @@ func New(config *config.Config, processor message.Processor, log *logrus.Logger)
|
|||
// Route satisfies the RESTAPIModule interface
|
||||
func (m *Module) Route(s router.Router) error {
|
||||
s.AttachHandler(http.MethodPost, BasePath, m.MediaCreatePOSTHandler)
|
||||
s.AttachHandler(http.MethodGet, BasePathWithID, m.MediaGETHandler)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue