From c3e9a3ab0025e20f5dc6e2b1c968ff5108d529fd Mon Sep 17 00:00:00 2001
From: Flummi <flummi@f0ck.space>
Date: Thu, 24 Mar 2022 17:17:55 +0100
Subject: [PATCH] add more methods

---
 package.json   |  2 +-
 src/router.mjs | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 3655684..4edad19 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "flummpress",
-  "version": "2.0.1",
+  "version": "2.0.2",
   "description": "Express für arme",
   "main": "src/index.mjs",
   "repository": {
diff --git a/src/router.mjs b/src/router.mjs
index f25e483..1bed06a 100644
--- a/src/router.mjs
+++ b/src/router.mjs
@@ -26,6 +26,10 @@ export default class Router {
     const methods = {
       get:  this.get.bind(this),
       post: this.post.bind(this),
+      head: this.head.bind(this),
+      put: this.put.bind(this),
+      delete: this.delete.bind(this),
+      patch: this.patch.bind(this),
     };
     const target = {
       path: new RegExp(path),
@@ -69,6 +73,38 @@ export default class Router {
     return this;
   };
 
+  head(path, ...args) {
+    if(args.length === 1)
+      this.registerRoute(path, args[0], "head");
+    else
+      this.registerRoute(path, args[1], "head", args[0]);
+    return this;
+  };
+
+  put(path, ...args) {
+    if(args.length === 1)
+      this.registerRoute(path, args[0], "put");
+    else
+      this.registerRoute(path, args[1], "put", args[0]);
+    return this;
+  };
+
+  delete(path, ...args) {
+    if(args.length === 1)
+      this.registerRoute(path, args[0], "delete");
+    else
+      this.registerRoute(path, args[1], "delete", args[0]);
+    return this;
+  };
+
+  patch(path, ...args) {
+    if(args.length === 1)
+      this.registerRoute(path, args[0], "patch");
+    else
+      this.registerRoute(path, args[1], "patch", args[0]);
+    return this;
+  };
+
   registerRoute(path, cb, method, middleware) {
     if(!this.routes.has(path))
       this.routes.set(path, {});