render-products
This commit is contained in:
+11
-3
@@ -14,14 +14,22 @@
|
||||
(defparameter *template-root* "
|
||||
<title> Lisp web app </title>
|
||||
<body>
|
||||
hello app
|
||||
<ul>
|
||||
{% for product in products %}
|
||||
<li> {{ product.1 }} - {{ product.2 }} </li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</body>
|
||||
")
|
||||
|
||||
(defroute root ("/" :method :get) ()
|
||||
(defun render-products ()
|
||||
(djula:render-template*
|
||||
(djula:compile-string *template-root*)
|
||||
nil))
|
||||
nil
|
||||
:products (products)))
|
||||
|
||||
(defroute root ("/" :method :get) ()
|
||||
(render-products))
|
||||
|
||||
(defun start-server (&key (port *port*))
|
||||
(format t "~&Starting the web server on port ~a~&" port)
|
||||
|
||||
Reference in New Issue
Block a user