From 9e0bcb6ea28ce130b3fc4c1635e3cda319671b3d Mon Sep 17 00:00:00 2001 From: jichangjun Date: Mon, 18 Mar 2024 20:46:54 +0800 Subject: [PATCH] feat: support http delete method --- classfile.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classfile.go b/classfile.go index 0102f25..789a9cf 100644 --- a/classfile.go +++ b/classfile.go @@ -63,6 +63,11 @@ func (p *App) Patch(path string, handle func(ctx *Context)) { p.Route(http.MethodPatch, path, handle) } +// Delete is a shortcut for router.Route(http.MethodDelete, path, handle) +func (p *App) Delete(path string, handle func(ctx *Context)) { + p.Route(http.MethodDelete, path, handle) +} + // Static serves static files from a dir (default is "$YapFS/static"). func (p *App) Static__0(pattern string, dir ...fs.FS) { p.Static(pattern, dir...)