From 5218e427d5168e7e16a2338040ed28398a264ae8 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 1 Jul 2022 03:32:53 +0400 Subject: [PATCH] Added POST and DELETE methods handlers for file deletion in main. --- cmd/dwelling-upload/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/dwelling-upload/main.go b/cmd/dwelling-upload/main.go index 6693991..73dd59d 100644 --- a/cmd/dwelling-upload/main.go +++ b/cmd/dwelling-upload/main.go @@ -91,7 +91,9 @@ func main() { srv.ServeStatic("/assets/*filepath", hand.AssetsFS()) srv.GET("/", hand.Index) srv.POST("/", hand.Upload) + srv.POST("/:hash/delete", hand.Delete) srv.GET("/f/:hash/:name", hand.Download) + srv.DELETE("/:hash", hand.Delete) if err := srv.Start(config.SplitNetworkAddress()); err != nil { logErr.Fatalln("failed to start a server:", err)