summaryrefslogtreecommitdiffstats
path: root/main.scm
diff options
context:
space:
mode:
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.scm b/main.scm
index c87f294..c3bfe98 100644
--- a/main.scm
+++ b/main.scm
@@ -57,9 +57,6 @@
; (port (request-port request)))
; (read-u8vector len port)))
-(define stylesheet (read-string #f
- (open-input-file "./style.css" #:text)))
-
(define (top-posts) (map-row list db
"SELECT p.id, p.user_id, p.content, p.created_at, p.parent_id, count(c.id)
FROM posts p
@@ -257,14 +254,13 @@
next
"/")))
+
(define routes
`(
(GET (/ "style.css") ,(lambda (rt)
- (send-response
- headers: `((content-type text/css))
- status: 'ok
- body: stylesheet
- )))
+ (send-static-file "style.css")))
+ (GET (/ "favicon.ico") ,(lambda (rt)
+ (send-static-file "favicon.ico")))
(GET (/ "unvote") ,(lambda (rt)
(unvote (get-current-user))
(send-response
@@ -376,5 +372,6 @@
((third route) route)
(begin (display uri ) (display method) (send-status 'not-found "Page Not Found")))))
+(root-path ".")
(vhost-map `((".*" . ,handle)))
(start-server port: 7080)