web/server: use woo as server component, + fixing stream access; + other fixes
This commit is contained in:
parent
10948ef009
commit
f248fc9e67
3 changed files with 8 additions and 3 deletions
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
(defclass action-spec ()
|
(defclass action-spec ()
|
||||||
((pattern :reader pattern :initarg :pattern :initform nil)
|
((pattern :reader pattern :initarg :pattern :initform nil)
|
||||||
(handlers :reader handlers :initarg :handlers)))
|
(handlers :accessor handlers :initarg :handlers)))
|
||||||
|
|
||||||
(defun select (msg acts)
|
(defun select (msg acts)
|
||||||
(let ((h (message:head-as-list msg))
|
(let ((h (message:head-as-list msg))
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
:version "0.0.1"
|
:version "0.0.1"
|
||||||
:homepage "https://www.cyberconcepts.org"
|
:homepage "https://www.cyberconcepts.org"
|
||||||
:description "Web client and server functionality."
|
:description "Web client and server functionality."
|
||||||
:depends-on (:clack :dexador :lack :lack-component :lack-app-file :quri
|
:depends-on (:clack :dexador :flexi-streams
|
||||||
|
:lack :lack-component :lack-app-file :quri
|
||||||
:scopes-core)
|
:scopes-core)
|
||||||
:components ((:file "web/client")
|
:components ((:file "web/client")
|
||||||
(:file "web/server"))
|
(:file "web/server"))
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
;;;; listener = server process
|
;;;; listener = server process
|
||||||
|
|
||||||
(defun app (ctx env)
|
(defun app (ctx env)
|
||||||
|
;(print env)
|
||||||
(funcall (select-app ctx env)))
|
(funcall (select-app ctx env)))
|
||||||
|
|
||||||
(defun start (ctx)
|
(defun start (ctx)
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
(clack:clackup #'(lambda (env) (app ctx env))
|
(clack:clackup #'(lambda (env) (app ctx env))
|
||||||
:port (parse-integer (port cfg))
|
:port (parse-integer (port cfg))
|
||||||
:address (address cfg)
|
:address (address cfg)
|
||||||
|
:server :woo
|
||||||
:silent t))))
|
:silent t))))
|
||||||
|
|
||||||
(defun stop (ctx)
|
(defun stop (ctx)
|
||||||
|
@ -86,7 +88,9 @@
|
||||||
(mapcar #'(lambda (e) (as-keyword e)) (getf env :message-head)))
|
(mapcar #'(lambda (e) (as-keyword e)) (getf env :message-head)))
|
||||||
|
|
||||||
(defun post-data (env)
|
(defun post-data (env)
|
||||||
(quri.decode:url-decode-params (read-line (getf env :raw-body))))
|
(let* ((raw (getf env :raw-body))
|
||||||
|
(str (read-line (flexi-streams:make-flexi-stream raw))))
|
||||||
|
(quri.decode:url-decode-params str)))
|
||||||
|
|
||||||
(defun plist (alst)
|
(defun plist (alst)
|
||||||
(let ((a2 (mapcar #'(lambda (p) (cons (as-keyword (car p)) (cdr p))) alst)))
|
(let ((a2 (mapcar #'(lambda (p) (cons (as-keyword (car p)) (cdr p))) alst)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue