Skip to content

Instantly share code, notes, and snippets.

@m2ym
Created November 25, 2012 16:15
Show Gist options
  • Save m2ym/4144205 to your computer and use it in GitHub Desktop.
Save m2ym/4144205 to your computer and use it in GitHub Desktop.
Clack + Optima
(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