render-products

This commit is contained in:
2026-08-05 01:14:48 +03:00
parent e8372bdb42
commit e0518f4dbd
+11 -3
View File
@@ -14,14 +14,22 @@
(defparameter *template-root* " (defparameter *template-root* "
<title> Lisp web app </title> <title> Lisp web app </title>
<body> <body>
hello app <ul>
{% for product in products %}
<li> {{ product.1 }} - {{ product.2 }} </li>
{% endfor %}
</ul>
</body> </body>
") ")
(defroute root ("/" :method :get) () (defun render-products ()
(djula:render-template* (djula:render-template*
(djula:compile-string *template-root*) (djula:compile-string *template-root*)
nil)) nil
:products (products)))
(defroute root ("/" :method :get) ()
(render-products))
(defun start-server (&key (port *port*)) (defun start-server (&key (port *port*))
(format t "~&Starting the web server on port ~a~&" port) (format t "~&Starting the web server on port ~a~&" port)