Skip to content

Instantly share code, notes, and snippets.

@joekarma
Created March 25, 2012 22:17
Show Gist options
  • Save joekarma/2200355 to your computer and use it in GitHub Desktop.
Save joekarma/2200355 to your computer and use it in GitHub Desktop.
(defpackage :hunchentoot-demo
(:use :cl :alexandria))
(in-package :hunchentoot-demo)
(defclass acceptor (hunchentoot:acceptor) ())
(defvar *acceptor* (make-instance 'acceptor
:port 8080))
(defun foo (request)
(format nil "~a" request))
(defun index (request)
(format nil "~a" (get-universal-time)))
(defmethod hunchentoot:handle-request ((acceptor hunchentoot-demo::acceptor) request)
(defun get-last-request () request)
(funcall
(switch ((hunchentoot:request-uri request)
:test #'string=)
("/" #'index)
("/foo" #'foo))
request))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment