Created
November 25, 2012 16:15
-
-
Save m2ym/4144205 to your computer and use it in GitHub Desktop.
Clack + Optima
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload '(:clack :optima :optima.ppcre)) | |
(defpackage :demo | |
(:use :cl :optima :optima.extra :optima.ppcre)) | |
(in-package :demo) | |
(defun app (env) | |
(match env | |
((plist :request-method :get | |
:request-uri (or "/" (ppcre "^/(.+)$" name))) | |
`(200 nil (,(format nil "Hello, ~A!" (or name "Guest"))))))) | |
(clack:clackup (lambda (env) (funcall 'app env))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment