summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2023-03-01 13:11:48 -0500
committerdan <[email protected]>2023-03-01 13:11:48 -0500
commit4eacc5129b8612b65cf6b28b739cf8e62e616405 (patch)
tree066d463b4c17584a4646e984a3b2deba8541fe62
parente8451607fa1a2ce12f492eca7a15915f672bb666 (diff)
download54-4eacc5129b8612b65cf6b28b739cf8e62e616405.tar.gz
54-4eacc5129b8612b65cf6b28b739cf8e62e616405.tar.bz2
54-4eacc5129b8612b65cf6b28b739cf8e62e616405.zip
style.css and favicon.ico properly hosted
-rw-r--r--main.scm13
-rw-r--r--makefile1
2 files changed, 6 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)
diff --git a/makefile b/makefile
index 31512c3..afb604d 100644
--- a/makefile
+++ b/makefile
@@ -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 \