From 351f5dda4bcdf451957bbff1e3769efddb02989d Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 1 Jul 2022 03:26:15 +0400 Subject: [PATCH] Added DELETE method handler setter for HTTP server. --- pkg/server/http.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/server/http.go b/pkg/server/http.go index 34b8cb6..2fb6c74 100644 --- a/pkg/server/http.go +++ b/pkg/server/http.go @@ -36,6 +36,10 @@ func (s *HttpServer) POST(path string, handler http.HandlerFunc) { s.router.Handler(http.MethodPost, path, handler) } +func (s *HttpServer) DELETE(path string, handler http.HandlerFunc) { + s.router.Handler(http.MethodDelete, path, handler) +} + func (s *HttpServer) ServeStatic(path string, fsys http.FileSystem) { s.router.ServeFiles(path, fsys) }