Paperclip/pkg/internal/server/api/index.go

39 lines
1.3 KiB
Go
Raw Normal View History

package api
import "github.com/gofiber/fiber/v2"
2024-07-16 09:02:16 +00:00
func MapAPIs(app *fiber.App, baseURL string) {
app.Get("/.well-known/destinations", getDestinations)
2024-07-16 09:02:16 +00:00
api := app.Group(baseURL).Name("API")
{
2024-08-18 04:01:41 +00:00
api.Get("/pools", listPost)
api.Get("/pools/:id", getPool)
api.Post("/pools", createPool)
api.Put("/pools/:id", updatePool)
api.Delete("/pools/:id", deletePool)
2024-07-25 14:12:00 +00:00
api.Get("/attachments", listAttachment)
api.Get("/attachments/:id/meta", getAttachmentMeta)
api.Get("/attachments/:id", openAttachment)
2024-08-20 09:08:40 +00:00
api.Post("/attachments", createAttachmentDirectly)
api.Put("/attachments/:id", updateAttachmentMeta)
api.Delete("/attachments/:id", deleteAttachment)
2024-08-03 07:43:15 +00:00
2024-08-20 09:08:40 +00:00
api.Post("/attachments/multipart", createAttachmentMultipartPlaceholder)
api.Post("/attachments/multipart/:file/:chunk", uploadAttachmentMultipart)
2024-08-03 08:16:14 +00:00
api.Get("/stickers/manifest", listStickerManifest)
2024-08-03 07:43:15 +00:00
api.Get("/stickers/packs", listStickerPacks)
api.Post("/stickers/packs", createStickerPack)
api.Put("/stickers/packs/:packId", updateStickerPack)
api.Delete("/stickers/packs/:packId", deleteStickerPack)
2024-08-03 08:16:14 +00:00
api.Get("/stickers", listStickers)
2024-08-03 07:43:15 +00:00
api.Get("/stickers/:stickerId", getSticker)
api.Post("/stickers", createSticker)
api.Put("/stickers/:stickerId", updateSticker)
api.Delete("/stickers/:stickerId", deleteSticker)
}
}