This commit is contained in:
SongWei 2020-02-13 21:21:31 +11:00
commit 643a332039
1 changed files with 22 additions and 0 deletions

22
server.lisp Normal file
View File

@ -0,0 +1,22 @@
(ql:quickload :woo)
(ql:quickload :flexi-streams)
(with-input-from-string (s "hahah 2333333")
(read-line s))
(woo:run
(lambda (env)
(print env)
(print (type-of env))
(if (eq :post (getf env :request-method))
(let* ((post-stream (getf env :raw-body))
(char-stream (flexi-streams:make-flexi-stream
post-stream
:external-format :utf-8)))
(format t (read-line char-stream))))
(format t "ret")
'(200 (:content-type "text/plain") ("Hello, World"))))
(type-of 1)