diff options
-rw-r--r-- | src/client/parenscript.lisp | 7 | ||||
-rw-r--r-- | src/lazybones.lisp | 7 | ||||
-rw-r--r-- | src/package.lisp | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/client/parenscript.lisp b/src/client/parenscript.lisp index 2b393bc..141c9cd 100644 --- a/src/client/parenscript.lisp +++ b/src/client/parenscript.lisp @@ -2,7 +2,8 @@ (:use #:cl) (:local-nicknames (#:lzb #:lazybones) (#:a #:alexandria)) - (:export #:generate)) + (:export #:generate + #:generate-js)) (in-package :lazybones/client.parenscript) @@ -142,7 +143,7 @@ is the value of the endpoint's DISPATCH-PATTERN slot." (gensym "MODULE")) (module-name - (intern (lispify (symbol-name (lzb::app-name app))))) + (intern (lispify (concatenate 'string "-" (symbol-name (lzb::app-name app)))))) (defuns (loop :for ep :in (lzb:app-endpoints app) @@ -161,3 +162,5 @@ is the value of the endpoint's DISPATCH-PATTERN slot." ,module) (ps:create))))) +(defun generate-js (app) + (eval `(ps:ps ,(generate app)))) diff --git a/src/lazybones.lisp b/src/lazybones.lisp index d993f1d..d1e186e 100644 --- a/src/lazybones.lisp +++ b/src/lazybones.lisp @@ -462,6 +462,13 @@ making a new one if not." "Singals an HTTP-ERROR with code and content." (signal 'http-error :content content :code code)) +(defun http-redirect (location) + "Set the lazybones response header and response code for redirecting to LOCATION. +This procedure will error if lazybones:*response* is not currently bound." + (setf (response-header :location) location + (response-code) "303")) + + ;;; MANAGING DEFINITIONS diff --git a/src/package.lisp b/src/package.lisp index 3ef4dcc..ca8c1b0 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -68,6 +68,7 @@ #:let-parameters #:map-parameters #:http-err + #:http-redirect #:http-respond #:install-app #:request-body |