diff options
author | Colin Okay <okay@toyful.space> | 2022-02-06 08:31:50 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-02-06 08:31:50 -0600 |
commit | f4516bd373812b81261c3018c39de7b6fe141d6b (patch) | |
tree | 2d716f8ffaf85f16033b7fa3f7ad1c64f9ce3003 /lazybones.lisp | |
parent | b3e6b285bb39df9855f36be49f2fc416623c8414 (diff) |
binding of dynamic variables pushed to run-endpoint
Diffstat (limited to 'lazybones.lisp')
-rw-r--r-- | lazybones.lisp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lazybones.lisp b/lazybones.lisp index 593328e..db1ca2a 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -14,6 +14,10 @@ bound and available to each handler. The exact object bound *response* varies according to the current backend. ") +(defvar *app* nil + "Dynamic variable holding the an APP instance. Dynamically bound by + RUN-ENDPOINT so that it is available if needed in request handlers.") + ;;; LAZYBONES CLASSES (defclass app () @@ -162,6 +166,8 @@ Returns NIL on failure." (list (gensym var-name)))))) -(defun run-endpoint (endpoint args &optional (request *request*)) - (let ((*request* request)) +(defun run-endpoint (endpoint args request response app) + (let ((*request* request) + (*response* response) + (*app* app)) (apply (endpoint-request-handler endpoint) args))) |