diff options
author | dan <[email protected]> | 2023-03-01 13:11:48 -0500 |
---|---|---|
committer | dan <[email protected]> | 2023-03-01 13:11:48 -0500 |
commit | 4eacc5129b8612b65cf6b28b739cf8e62e616405 (patch) | |
tree | 066d463b4c17584a4646e984a3b2deba8541fe62 | |
parent | e8451607fa1a2ce12f492eca7a15915f672bb666 (diff) | |
download | 54-4eacc5129b8612b65cf6b28b739cf8e62e616405.tar.gz 54-4eacc5129b8612b65cf6b28b739cf8e62e616405.tar.bz2 54-4eacc5129b8612b65cf6b28b739cf8e62e616405.zip |
style.css and favicon.ico properly hosted
-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 \ |