Paperclip/pkg/internal/server/api/index.go
2024-07-25 22:02:26 +08:00

18 lines
481 B
Go

package api
import "github.com/gofiber/fiber/v2"
func MapAPIs(app *fiber.App, baseURL string) {
app.Get("/.well-known/destinations", getDestinations)
api := app.Group(baseURL).Name("API")
{
api.Get("/attachments", list)
api.Get("/attachments/:id/meta", getAttachmentMeta)
api.Get("/attachments/:id", openAttachment)
api.Post("/attachments", createAttachment)
api.Put("/attachments/:id", updateAttachmentMeta)
api.Delete("/attachments/:id", deleteAttachment)
}
}