add route for thoughts/blog
This commit is contained in:
@ -8,6 +8,9 @@
|
|||||||
(import bleach [clean])
|
(import bleach [clean])
|
||||||
(import validators [domain :as domain?])
|
(import validators [domain :as domain?])
|
||||||
|
|
||||||
|
(defmacro unless [test #* body]
|
||||||
|
`(when (not ~test) (do ~@body)))
|
||||||
|
|
||||||
(defn error [code message]
|
(defn error [code message]
|
||||||
(return (dict
|
(return (dict
|
||||||
:code code
|
:code code
|
||||||
@ -30,9 +33,14 @@
|
|||||||
(return (error 405 "method not allowed")))
|
(return (error 405 "method not allowed")))
|
||||||
|
|
||||||
(when (file? (+ "./www/site/html" path))
|
(when (file? (+ "./www/site/html" path))
|
||||||
|
(unless (= path "/html/view-thought.html")
|
||||||
|
(return (dict
|
||||||
|
:code 200
|
||||||
|
:body (parse-html-file f"./www/site/html{path}"))))
|
||||||
|
|
||||||
(return (dict
|
(return (dict
|
||||||
:code 200
|
:code 200
|
||||||
:body (parse-html-file f"./www/site/html{path}")))))
|
:body (parse-html-file "./www/site/html/html/view-thought.html" #** (. request (get "route") (get "parameters")))))))
|
||||||
|
|
||||||
(when (= path "/style.css")
|
(when (= path "/style.css")
|
||||||
(when (!= method "GET")
|
(when (!= method "GET")
|
||||||
|
Reference in New Issue
Block a user