aboutsummaryrefslogtreecommitdiffstats
path: root/hypo.hy
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-08-25 23:21:39 +0200
committerGravatar Tom Willemse2013-08-25 23:21:39 +0200
commit96bfb88a5e348c7bfad56d34eebaa891b68e2773 (patch)
tree52a7c9ab13f3e2c6e658980cf547a095e7e1b1a2 /hypo.hy
parent71adee48209840198f90a6b9da33b73830ebbfeb (diff)
downloadhypo-96bfb88a5e348c7bfad56d34eebaa891b68e2773.tar.gz
hypo-96bfb88a5e348c7bfad56d34eebaa891b68e2773.zip
Update README, add index page
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))))