aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--__main__.py4
-rw-r--r--helpers.py5
2 files changed, 3 insertions, 6 deletions
diff --git a/__main__.py b/__main__.py
index 95b78ab..44f9892 100644
--- a/__main__.py
+++ b/__main__.py
@@ -18,10 +18,6 @@ from .routes import *
import time
sys.tracebacklimit = 1000
-@route("/api")
-def get_root():
- notAllowed()
-
if __name__ == "__main__":
def loadEntries():
for handler in [CC(), CCAN()]:
diff --git a/helpers.py b/helpers.py
index c748839..f3caac6 100644
--- a/helpers.py
+++ b/helpers.py
@@ -53,8 +53,9 @@ def calculateHashForFile(file, hashobj : object = None) -> object:
return hashobj
-def notAllowed():
- raise HTTPResponse(f"Cannot {request.method} {request.path}")
+@route("<path:path>")
+def default(path):
+ raise HTTPResponse(f"Cannot {request.method} {path}", 405)
@route("<path:path>", method="OPTIONS")
def options(path):