异步 HTTP 服务器:Wookie
mmxn
9年前
Wookie 是一个用 Common Lisp 编写的异步 HTTP 服务器,基于 cl-async 和 http-parse 构建。
示例代码:
(defpackage :wookie-test
(:use :cl :wookie))
(in-package :wookie-test)
;; load Wookie's core plugins
(load-plugins)
;; define our homepage route
(defroute (:get "/") (req res)
(send-response res :body "Thanks for stopping by!"))
;; start serving requests!
(as:with-event-loop ()
(start-server (make-instance 'listener :port 80)))