Refactor Tailwind CSS server handling
This commit is contained in:
parent
7bddd59dab
commit
340dd47e0d
5 changed files with 16 additions and 13 deletions
|
@ -11,8 +11,6 @@
|
|||
(defparameter *app* (jg:make-app :address "localhost"
|
||||
:port env:*port*))
|
||||
|
||||
(jg:clear-middlewares *app*)
|
||||
(jg:clear-routing-rules *app*)
|
||||
(fbr:assign-routes *app* :system "hp" :directory "src/routes")
|
||||
(jg:install-middleware *app* mw:*recoverer*)
|
||||
(jg:install-middleware *app* mw:*path-normalizer*)
|
||||
|
|
|
@ -10,16 +10,10 @@
|
|||
#:update))
|
||||
(in-package #:hp)
|
||||
|
||||
(defparameter *watch-process* nil)
|
||||
|
||||
(defun start ()
|
||||
(when (env:dev-mode-p)
|
||||
(setf *watch-process* (uiop:launch-program "make watch")))
|
||||
(jg:start *app*))
|
||||
|
||||
(defun stop ()
|
||||
(when (env:dev-mode-p)
|
||||
(uiop:terminate-process *watch-process*))
|
||||
(jg:stop *app*))
|
||||
|
||||
(defun update ()
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
(defpackage #:hp/renderer
|
||||
(:use #:cl
|
||||
#:hsx)
|
||||
(:local-nicknames (#:jg #:jingle)))
|
||||
(:local-nicknames (#:jg #:jingle))
|
||||
(:local-nicknames (#:env #:hp/env)))
|
||||
(in-package #:hp/renderer)
|
||||
|
||||
(defcomp document (&key title description children)
|
||||
|
@ -26,6 +27,8 @@
|
|||
|
||||
(defmethod jg:process-response ((app jg:app) result)
|
||||
(jg:set-response-header :content-type "text/html; charset=utf-8")
|
||||
(when (env:dev-mode-p)
|
||||
(jg:set-response-header :cache-control "no-store"))
|
||||
(call-next-method app
|
||||
(hsx:render-to-string
|
||||
(if (listp result)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
open: false,
|
||||
get isOpen() { return this.open },
|
||||
toggle() { this.open = ! this.open },
|
||||
}"
|
||||
}"
|
||||
(button :@click "toggle()"
|
||||
"Toggle")
|
||||
(div :x-show "isOpen"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue