Building a Dynamic Website
To try out our shiny new web server, let’s build a simple site that greets a visitor, using the dirt-simple function hello-request-handler
:
(defun hello-request-handler (path header params) (if (equal path "greeting") (let ((name (assoc 'name params))) (format t "HTTP/1.1 200 OK~%~%") (if (not name) (princ "<html><form>What is your name?<input name='name' /> </form></html>") (format t "<html>Nice to meet you, ˜a!</html>" ...
Get Land of Lisp now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.