From 3c47d42ba723e19628593d2e3db2542ed61857fb Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Mon, 6 Feb 2023 01:59:33 +0400 Subject: [PATCH] Added DELETE method to server. --- internal/http/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/http/server.go b/internal/http/server.go index b4fedf2..3212dce 100644 --- a/internal/http/server.go +++ b/internal/http/server.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) }