mirror of
https://codeberg.org/scip/ephemerup.git
synced 2025-12-18 21:11:04 +01:00
+api doc, fixed endpoints
This commit is contained in:
@@ -56,33 +56,30 @@ func Runserver(conf *cfg.Config, args []string) error {
|
||||
api := router.Group(conf.ApiPrefix + ApiVersion)
|
||||
{
|
||||
// upload
|
||||
api.Post("/file/", auth, func(c *fiber.Ctx) error {
|
||||
api.Post("/uploads/", auth, func(c *fiber.Ctx) error {
|
||||
return FilePut(c, conf, db)
|
||||
})
|
||||
|
||||
// download w/o expire
|
||||
api.Get("/file/:id/:file", auth, func(c *fiber.Ctx) error {
|
||||
return FileGet(c, conf, db)
|
||||
})
|
||||
api.Get("/file/:id/", auth, func(c *fiber.Ctx) error {
|
||||
return FileGet(c, conf, db)
|
||||
})
|
||||
|
||||
// remove
|
||||
api.Delete("/file/:id/", auth, func(c *fiber.Ctx) error {
|
||||
api.Delete("/uploads/:id/", auth, func(c *fiber.Ctx) error {
|
||||
err := DeleteUpload(c, conf, db)
|
||||
return SendResponse(c, "", err)
|
||||
})
|
||||
|
||||
// listing
|
||||
api.Get("/list/", auth, func(c *fiber.Ctx) error {
|
||||
api.Get("/uploads", auth, func(c *fiber.Ctx) error {
|
||||
return List(c, conf, db)
|
||||
})
|
||||
|
||||
// info
|
||||
// info/describe
|
||||
api.Get("/upload/:id/", auth, func(c *fiber.Ctx) error {
|
||||
return Describe(c, conf, db)
|
||||
})
|
||||
|
||||
// download w/o expire
|
||||
api.Get("/download/:id/", auth, func(c *fiber.Ctx) error {
|
||||
return FileGet(c, conf, db)
|
||||
})
|
||||
}
|
||||
|
||||
// public routes
|
||||
|
||||
Reference in New Issue
Block a user