diff --git a/src/web-app.lisp b/src/web-app.lisp index 70e9891..644896c 100644 --- a/src/web-app.lisp +++ b/src/web-app.lisp @@ -1,36 +1,55 @@ (in-package :web-apps) +(defun get-product (n) + ;; Query the DB. + (list n (format nil "Product nb ~a" n) 9.99)) + (defun products (&optional (n 5)) (loop for i from 0 below n - collect (list i - (format nil "Product nb ~a" i) - 9.99))) + collect (get-product i))) (defvar *server* nil "Server instance (Hunchentoot acceptor).") (defparameter *port* 8899 "The application port.") +(defun render (template &rest args) + (apply + #'djula:render-template* + (djula:compile-string template) + nil + args)) + (defparameter *template-root* "