Added POST and DELETE methods handlers for file deletion in main.
This commit is contained in:
parent
2cf7e80480
commit
5218e427d5
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user