aboutsummaryrefslogtreecommitdiffstats
path: root/hypo.hy
diff options
context:
space:
mode:
Diffstat (limited to 'hypo.hy')
-rwxr-xr-xhypo.hy6
1 files changed, 5 insertions, 1 deletions
diff --git a/hypo.hy b/hypo.hy
index a749984..b694596 100755
--- a/hypo.hy
+++ b/hypo.hy
@@ -28,7 +28,8 @@
(sys.exit 1)))
(def render (web.template.render "templates/"))
-(def urls (, (+ "/" *prefix* "raw/(.*)") "raw"
+(def urls (, (+ "/" *prefix*) "index"
+ (+ "/" *prefix* "raw/(.*)") "raw"
(+ "/" *prefix* "dl/(.*)") "download"
(+ "/" *prefix* "([a-f0-9]{7})$") "html"
(+ "/" *prefix* "(.*)") "upload"))
@@ -137,6 +138,9 @@ If no lexer is found fallback onto the text lexer."
(setv web.ctx.status (str "201 Created"))
(+ web.ctx.home "/" *prefix* (get h 0) "\n")))]])
+(defclass index []
+ [[GET (lambda [self] (render.index))]])
+
(defun hypo-start [argv]
(let ((sys.argv (cdr sys.argv))
(app (web.application urls (globals))))