diff options
-rw-r--r-- | main.scm | 13 | ||||
-rw-r--r-- | makefile | 1 |
2 files changed, 6 insertions, 8 deletions
@@ -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) @@ -4,6 +4,7 @@ build: ./main.scm mv ./main ./build/main deploy: build cp ./style.css ./build/style.css + cp ./favicon_io/favicon.ico ./build/favicon.ico scp ./build/* dotemgo-tasks_root:/root/ ssh dotemgo-tasks_root 'systemctl stop itter.service \ && mv /root/main /root/54itter \ |