✨ Moment editor C-V upload attachment
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"git.solsynth.dev/hydrogen/interactive/pkg/models"
|
||||
"git.solsynth.dev/hydrogen/interactive/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/spf13/viper"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func openAttachment(c *fiber.Ctx) error {
|
||||
func readAttachment(c *fiber.Ctx) error {
|
||||
id := c.Params("fileId")
|
||||
basepath := viper.GetString("content")
|
||||
|
||||
|
@ -66,7 +66,7 @@ func NewServer() {
|
||||
api.Get("/attachments/o/:fileId", cache.New(cache.Config{
|
||||
Expiration: 365 * 24 * time.Hour,
|
||||
CacheControl: true,
|
||||
}), openAttachment)
|
||||
}), readAttachment)
|
||||
api.Post("/attachments", authMiddleware, uploadAttachment)
|
||||
|
||||
api.Get("/feed", listFeed)
|
||||
|
Reference in New Issue
Block a user