1
0

Added POST and DELETE methods handlers for file deletion in main.

This commit is contained in:
Alexander Andreev 2022-07-01 03:32:53 +04:00
parent 2cf7e80480
commit 5218e427d5
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -91,7 +91,9 @@ func main() {
srv.ServeStatic("/assets/*filepath", hand.AssetsFS()) srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
srv.GET("/", hand.Index) srv.GET("/", hand.Index)
srv.POST("/", hand.Upload) srv.POST("/", hand.Upload)
srv.POST("/:hash/delete", hand.Delete)
srv.GET("/f/:hash/:name", hand.Download) srv.GET("/f/:hash/:name", hand.Download)
srv.DELETE("/:hash", hand.Delete)
if err := srv.Start(config.SplitNetworkAddress()); err != nil { if err := srv.Start(config.SplitNetworkAddress()); err != nil {
logErr.Fatalln("failed to start a server:", err) logErr.Fatalln("failed to start a server:", err)