Started working on emoji

This commit is contained in:
tsmethurst
2021-04-13 11:56:12 +02:00
parent 2e7ac10d00
commit 9826f3f6d9
16 changed files with 75 additions and 14 deletions

View File

@ -36,6 +36,10 @@ const (
mediaTypeKey = "media_type"
mediaSizeKey = "media_size"
fileNameKey = "file_name"
shortcodeKey = "shortcode"
emojisPath = "emojis"
filesPath = "files"
)
// fileServer implements the RESTAPIModule interface.
@ -62,6 +66,7 @@ func New(config *config.Config, db db.DB, storage storage.Storage, log *logrus.L
// Route satisfies the RESTAPIModule interface
func (m *fileServer) Route(s router.Router) error {
s.AttachHandler(http.MethodGet, fmt.Sprintf("%s/:%s/:%s/:%s/:%s", m.storageBase, accountIDKey, mediaTypeKey, mediaSizeKey, fileNameKey), m.ServeFile)
s.AttachHandler(http.MethodGet, fmt.Sprintf("%s/:%s/:%s/:%s/:%s", m.storageBase, accountIDKey, mediaTypeKey, mediaSizeKey, fileNameKey), m.serveEmoji)
return nil
}